use of io.dingodb.store.api.StoreInstance in project dingo by dingodb.
the class PartIteratorSourceOperator method init.
@Override
public void init() {
super.init();
StoreInstance store = Services.KV_STORE.getInstance(task.getLocation().getPath());
part = new PartInKvStore(store.getKvBlock(tableId, partId), schema, keyMapping);
}
use of io.dingodb.store.api.StoreInstance in project dingo by dingodb.
the class PartModifyOperator method init.
@Override
public void init() {
super.init();
StoreInstance store = Services.KV_STORE.getInstance(task.getLocation().getPath());
part = new PartInKvStore(store.getKvBlock(tableId, partId), schema, keyMapping);
count = 0;
}
use of io.dingodb.store.api.StoreInstance in project dingo by dingodb.
the class MetaTestService method createTable.
@Override
public void createTable(@Nonnull String tableName, @Nonnull TableDefinition tableDefinition) {
try {
OutputStream os = new FileOutputStream(metaFile(tableName));
tableDefinition.writeJson(os);
// force reload
tableDefinitionMap = null;
Map<String, Location> partLocations = getPartLocations(tableName);
for (Map.Entry<String, Location> entry : partLocations.entrySet()) {
StoreInstance store = Services.KV_STORE.getInstance(entry.getValue().getPath());
new PartInKvStore(store.getKvBlock(new TableId(getTableKey(tableName)), entry.getKey()), tableDefinition.getTupleSchema(), tableDefinition.getKeyMapping());
}
} catch (IOException e) {
log.error("Failed to write table definition: {}", tableDefinition);
throw new AssertionError("Failed to write table definition.");
}
}
Aggregations