Package org.apache.fluo.api.client
Interface FluoClient
-
- All Superinterfaces:
AutoCloseable
public interface FluoClient extends AutoCloseable
Client interface for Fluo. Fluo clients will have shared resources used by all objects created by the client. Therefore,close()
must called when you are finished using the client.- Since:
- 1.0.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
close()
Closes client resourcesSimpleConfiguration
getAppConfiguration()
MetricsReporter
getMetricsReporter()
LoaderExecutor
newLoaderExecutor()
Creates aLoaderExecutor
for loading data into Fluo.Snapshot
newSnapshot()
Creates aSnapshot
for reading data from Fluo.Transaction
newTransaction()
Creates aTransaction
for reading and writing data to Fluo.
-
-
-
Method Detail
-
newLoaderExecutor
LoaderExecutor newLoaderExecutor()
Creates aLoaderExecutor
for loading data into Fluo. Use within a try-with-resources statement or callLoaderExecutor.close()
when you are finished using it.
-
newSnapshot
Snapshot newSnapshot()
Creates aSnapshot
for reading data from Fluo. Use within a try-with-resources statement or callSnapshot.close()
when you are finished using it.
-
newTransaction
Transaction newTransaction()
Creates aTransaction
for reading and writing data to Fluo. Unlike the transactions provided by theLoader
andObserver
, users will need to callTransaction.commit()
. Use within a try-with-resources statement or callTransaction.close()
when you are finished.Executing many transactions using this method may be less optimal than using a LoaderExecutor. When a transaction created via this method is committed and closed, the caller must wait for data to be persisted. Using a LoaderExecutor, multiple transactions commit processing may be batched w/o the need to wait for each transaction until the LoaderExecutor is closed.
-
getAppConfiguration
SimpleConfiguration getAppConfiguration()
- Returns:
- All properties w/ the prefix
"fluo.app" that were set at
initialization time. The configuration returned is a subset of configuration using the
prefix "fluo.app" The reason
these properties are stored and read from zookeeper is to offer a consistent view of
application config across all nodes in the cluster. So there is no need to worry w/
keeping config files consistent across a cluster. To update this configuration, use
FluoAdmin.updateSharedConfig()
. Changes made to the returned Configuration will not update Zookeeper. - See Also:
FluoConfiguration.getAppConfiguration()
,ObserverProvider.Context.getAppConfiguration()
-
getMetricsReporter
MetricsReporter getMetricsReporter()
- Returns:
- A
MetricsReporter
that is used to report application metrics
-
close
void close()
Closes client resources- Specified by:
close
in interfaceAutoCloseable
-
-