public abstract class AbstractView extends Object
AbstractView requires a runtime, and provides a layoutHelper function.
The layoutHelper function is called whenever a view tries to access a layout. If the layoutHelper catches an exception which is due to connection issues or an incorrect epoch, it asks the runtime to invalidate that layout by reporting it to a layout server, and retries the function.
Created by mwei on 12/10/15.
Modifier and Type | Class and Description |
---|---|
static interface |
AbstractView.LayoutFunction<V,R,A extends Throwable,B extends Throwable,C extends Throwable,D extends Throwable> |
Constructor and Description |
---|
AbstractView(CorfuRuntime runtime) |
Modifier and Type | Method and Description |
---|---|
Layout |
getCurrentLayout()
Get the current layout.
|
<T,A extends RuntimeException,B extends RuntimeException,C extends RuntimeException,D extends RuntimeException> |
layoutHelper(AbstractView.LayoutFunction<Layout,T,A,B,C,D> function) |
<T,A extends RuntimeException,B extends RuntimeException,C extends RuntimeException,D extends RuntimeException> |
layoutHelper(AbstractView.LayoutFunction<Layout,T,A,B,C,D> function,
boolean rethrowAllExceptions)
Helper function for view to retrieve layouts.
|
public AbstractView(@Nonnull CorfuRuntime runtime)
public Layout getCurrentLayout()
public <T,A extends RuntimeException,B extends RuntimeException,C extends RuntimeException,D extends RuntimeException> T layoutHelper(AbstractView.LayoutFunction<Layout,T,A,B,C,D> function) throws A extends RuntimeException, B extends RuntimeException, C extends RuntimeException, D extends RuntimeException
A extends RuntimeException
public <T,A extends RuntimeException,B extends RuntimeException,C extends RuntimeException,D extends RuntimeException> T layoutHelper(AbstractView.LayoutFunction<Layout,T,A,B,C,D> function, boolean rethrowAllExceptions) throws A extends RuntimeException, B extends RuntimeException, C extends RuntimeException, D extends RuntimeException
T
- The return type of the function.A
- Any exception the function may throw.B
- Any exception the function may throw.C
- Any exception the function may throw.D
- Any exception the function may throw.function
- The function to execute.rethrowAllExceptions
- if all exceptions are rethrown to caller.A extends RuntimeException
Copyright © 2019 CorfuDB. All rights reserved.