co.cask.cdap.test
Interface DataSetManager<T>
- Type Parameters:
T - actual type of the dataset
public interface DataSetManager<T>
Instance of this class is for managing DataSet.
NOTE: changes made with the instance of the dataset acquired via get() are not visible to other components
unless flush() is called.
Typical usage for read:
ApplicationManager appManager = deployApplication(AppWithTable.class);
DataSetManager<Table> myTableManager = appManager.getDataset("my_table");
myTableManager = appManager.getDataset("my_table");
String value = myTableManager.get().get(new Get("key1", "column1")).getString("column1");
Typical usage for write:
ApplicationManager appManager = deployApplication(AppWithTable.class);
DataSetManager<Table> myTableManager = appManager.getDataset("my_table");
myTableManager.get().put(new Put("key1", "column1", "value1"));
myTableManager.flush();
|
Method Summary |
void |
flush()
Makes changes performed using dataset instance acquired via get() visible to all other components. |
T |
get()
|
get
T get()
- Returns:
- dataset instance.
NOTE: the returned instance of dataset will see only changes made before it was acquired.
flush
void flush()
- Makes changes performed using dataset instance acquired via
get() visible to all other components.
Can be called multiple times on same instance of the dataset.
Copyright © 2015 Cask Data, Inc. Licensed under the Apache License, Version 2.0.