public class OfflineSchemaUpdateHandler extends java.lang.Object implements SchemaUpdateHandler
Constructor and Description |
---|
OfflineSchemaUpdateHandler(java.util.function.BiConsumer<SchemaTransformation.SchemaTransformationResult,java.lang.Boolean> updateCallback) |
Modifier and Type | Method and Description |
---|---|
SchemaTransformation.SchemaTransformationResult |
apply(SchemaTransformation transformation,
boolean local)
Applies schema transformation in the underlying storage and synchronizes with other nodes.
|
Awaitable |
clear()
Marks the local schema to be cleared and refreshed.
|
void |
reset(boolean local)
Resets the schema either by reloading data from the local storage or from the other nodes.
|
void |
start()
Starts actively synchronizing schema with the rest of the cluster.
|
boolean |
waitUntilReady(java.time.Duration timeout)
Waits until the schema update handler is ready and returns the result.
|
public OfflineSchemaUpdateHandler(java.util.function.BiConsumer<SchemaTransformation.SchemaTransformationResult,java.lang.Boolean> updateCallback)
public void start()
SchemaUpdateHandler
SchemaUpdateHandler.waitUntilReady(Duration)
.start
in interface SchemaUpdateHandler
public boolean waitUntilReady(java.time.Duration timeout)
SchemaUpdateHandler
false
it
means that readiness could not be achieved within the specified period of time. The method can be used just to
check if schema is ready by passing Duration.ZERO
as the timeout - in such case it returns immediately.waitUntilReady
in interface SchemaUpdateHandler
timeout
- the maximum time to wait for schema readinesspublic SchemaTransformation.SchemaTransformationResult apply(SchemaTransformation transformation, boolean local)
SchemaUpdateHandler
apply
in interface SchemaUpdateHandler
transformation
- schema transformation to be performedlocal
- if true, the caller does not require synchronizing schema with other nodes - in practise local is
used only in some testspublic void reset(boolean local)
SchemaUpdateHandler
reset
in interface SchemaUpdateHandler
local
- whether we should reset with locally stored schema or fetch the schema from other nodespublic Awaitable clear()
SchemaUpdateHandler
clear
in interface SchemaUpdateHandler
Copyright © 2009- The Apache Software Foundation