use of org.apache.accumulo.core.metadata.schema.Ample.TabletMutator in project accumulo by apache.
the class MetadataTableUtil method addTablet.
public static void addTablet(KeyExtent extent, String path, ServerContext context, TimeType timeType, ServiceLock zooLock) {
TabletMutator tablet = context.getAmple().mutateTablet(extent);
tablet.putPrevEndRow(extent.prevEndRow());
tablet.putDirName(path);
tablet.putTime(new MetadataTime(0, timeType));
tablet.putZooLock(zooLock);
tablet.mutate();
}
use of org.apache.accumulo.core.metadata.schema.Ample.TabletMutator in project accumulo by apache.
the class MetadataTableUtil method updateTabletFlushID.
public static void updateTabletFlushID(KeyExtent extent, long flushID, ServerContext context, ServiceLock zooLock) {
TabletMutator tablet = context.getAmple().mutateTablet(extent);
tablet.putFlushId(flushID);
tablet.putZooLock(zooLock);
tablet.mutate();
}
use of org.apache.accumulo.core.metadata.schema.Ample.TabletMutator in project accumulo by apache.
the class MetadataTableUtil method updateTabletCompactID.
public static void updateTabletCompactID(KeyExtent extent, long compactID, ServerContext context, ServiceLock zooLock) {
TabletMutator tablet = context.getAmple().mutateTablet(extent);
tablet.putCompactionId(compactID);
tablet.putZooLock(zooLock);
tablet.mutate();
}
use of org.apache.accumulo.core.metadata.schema.Ample.TabletMutator in project accumulo by apache.
the class MetadataTableUtil method updateTabletVolumes.
public static void updateTabletVolumes(KeyExtent extent, List<LogEntry> logsToRemove, List<LogEntry> logsToAdd, List<StoredTabletFile> filesToRemove, SortedMap<TabletFile, DataFileValue> filesToAdd, ServiceLock zooLock, ServerContext context) {
TabletMutator tabletMutator = context.getAmple().mutateTablet(extent);
logsToRemove.forEach(tabletMutator::deleteWal);
logsToAdd.forEach(tabletMutator::putWal);
filesToRemove.forEach(tabletMutator::deleteFile);
filesToAdd.forEach(tabletMutator::putFile);
tabletMutator.putZooLock(zooLock);
tabletMutator.mutate();
}
use of org.apache.accumulo.core.metadata.schema.Ample.TabletMutator in project accumulo by apache.
the class MetaDataStateStore method unassign.
private void unassign(Collection<TabletLocationState> tablets, Map<TServerInstance, List<Path>> logsForDeadServers, long suspensionTimestamp) throws DistributedStoreException {
try (var tabletsMutator = ample.mutateTablets()) {
for (TabletLocationState tls : tablets) {
TabletMutator tabletMutator = tabletsMutator.mutateTablet(tls.extent);
if (tls.current != null) {
tabletMutator.deleteLocation(tls.current, LocationType.CURRENT);
if (logsForDeadServers != null) {
List<Path> logs = logsForDeadServers.get(tls.current);
if (logs != null) {
for (Path log : logs) {
LogEntry entry = new LogEntry(tls.extent, 0, log.toString());
tabletMutator.putWal(entry);
}
}
}
if (suspensionTimestamp >= 0) {
tabletMutator.putSuspension(tls.current, suspensionTimestamp);
}
}
if (tls.suspend != null && suspensionTimestamp < 0) {
tabletMutator.deleteSuspension();
}
if (tls.future != null) {
tabletMutator.deleteLocation(tls.future, LocationType.FUTURE);
}
tabletMutator.mutate();
}
} catch (RuntimeException ex) {
throw new DistributedStoreException(ex);
}
}
Aggregations