Search in sources :

Example 1 with StoreInstance

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);
}
Also used : PartInKvStore(io.dingodb.exec.table.PartInKvStore) StoreInstance(io.dingodb.store.api.StoreInstance)

Example 2 with StoreInstance

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;
}
Also used : PartInKvStore(io.dingodb.exec.table.PartInKvStore) StoreInstance(io.dingodb.store.api.StoreInstance)

Example 3 with StoreInstance

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.");
    }
}
Also used : TableId(io.dingodb.common.table.TableId) PartInKvStore(io.dingodb.exec.table.PartInKvStore) OutputStream(java.io.OutputStream) FileOutputStream(java.io.FileOutputStream) FileOutputStream(java.io.FileOutputStream) IOException(java.io.IOException) ImmutableMap(com.google.common.collect.ImmutableMap) LinkedHashMap(java.util.LinkedHashMap) Map(java.util.Map) StoreInstance(io.dingodb.store.api.StoreInstance) Location(io.dingodb.meta.Location)

Aggregations

PartInKvStore (io.dingodb.exec.table.PartInKvStore)3 StoreInstance (io.dingodb.store.api.StoreInstance)3 ImmutableMap (com.google.common.collect.ImmutableMap)1 TableId (io.dingodb.common.table.TableId)1 Location (io.dingodb.meta.Location)1 FileOutputStream (java.io.FileOutputStream)1 IOException (java.io.IOException)1 OutputStream (java.io.OutputStream)1 LinkedHashMap (java.util.LinkedHashMap)1 Map (java.util.Map)1