use of org.apache.accumulo.core.metadata.schema.MetadataTime in project accumulo by apache.
the class PopulateMetadata method writeSplitsToMetadataTable.
private void writeSplitsToMetadataTable(ServerContext context, TableId tableId, SortedSet<Text> splits, Map<Text, Text> data, TimeType timeType, ServiceLock lock, BatchWriter bw) throws MutationsRejectedException {
Text prevSplit = null;
Value dirValue;
for (Text split : Iterables.concat(splits, Collections.singleton(null))) {
Mutation mut = TabletColumnFamily.createPrevRowMutation(new KeyExtent(tableId, split, prevSplit));
dirValue = (split == null) ? new Value(ServerColumnFamily.DEFAULT_TABLET_DIR_NAME) : new Value(data.get(split));
ServerColumnFamily.DIRECTORY_COLUMN.put(mut, dirValue);
ServerColumnFamily.TIME_COLUMN.put(mut, new Value(new MetadataTime(0, timeType).encode()));
MetadataTableUtil.putLockID(context, lock, mut);
prevSplit = split;
bw.addMutation(mut);
}
}
use of org.apache.accumulo.core.metadata.schema.MetadataTime in project accumulo by apache.
the class TabletTimeTest method testGetInstance_Millis.
@Test
public void testGetInstance_Millis() {
TabletTime t = TabletTime.getInstance(new MetadataTime(1234, TimeType.MILLIS));
assertEquals(MillisTime.class, t.getClass());
assertEquals("M1234", t.getMetadataTime().encode());
}
use of org.apache.accumulo.core.metadata.schema.MetadataTime in project accumulo by apache.
the class TabletTimeTest method testGetInstance_Logical.
@Test
public void testGetInstance_Logical() {
TabletTime t = TabletTime.getInstance(new MetadataTime(1234, TimeType.LOGICAL));
assertEquals(LogicalTime.class, t.getClass());
assertEquals("L1234", t.getMetadataTime().encode());
}
Aggregations