use of org.apache.accumulo.core.client.Durability in project accumulo by apache.
the class TabletServer method minorCompactionFinished.
public void minorCompactionFinished(CommitSession tablet, String newDatafile, long walogSeq) throws IOException {
Durability durability = getMincEventDurability(tablet.getExtent());
totalMinorCompactions.incrementAndGet();
logger.minorCompactionFinished(tablet, newDatafile, walogSeq, durability);
markUnusedWALs();
}
use of org.apache.accumulo.core.client.Durability in project accumulo by apache.
the class TabletServer method minorCompactionStarted.
public void minorCompactionStarted(CommitSession tablet, long lastUpdateSequence, String newMapfileLocation) throws IOException {
Durability durability = getMincEventDurability(tablet.getExtent());
logger.minorCompactionStarted(tablet, lastUpdateSequence, newMapfileLocation, durability);
}
use of org.apache.accumulo.core.client.Durability in project accumulo by apache.
the class TabletServerLogger method logManyTablets.
public void logManyTablets(Map<CommitSession, Mutations> mutations) throws IOException {
final Map<CommitSession, Mutations> loggables = new HashMap<>(mutations);
for (Entry<CommitSession, Mutations> entry : mutations.entrySet()) {
if (entry.getValue().getDurability() == Durability.NONE) {
loggables.remove(entry.getKey());
}
}
if (loggables.size() == 0)
return;
write(loggables.keySet(), false, new Writer() {
@Override
public LoggerOperation write(DfsLogger logger) throws Exception {
List<TabletMutations> copy = new ArrayList<>(loggables.size());
for (Entry<CommitSession, Mutations> entry : loggables.entrySet()) {
CommitSession cs = entry.getKey();
Durability durability = entry.getValue().getDurability();
copy.add(new TabletMutations(cs.getLogId(), cs.getWALogSeq(), entry.getValue().getMutations(), durability));
}
return logger.logManyTablets(copy);
}
});
for (Mutations entry : loggables.values()) {
if (entry.getMutations().size() < 1) {
throw new IllegalArgumentException("logManyTablets: logging empty mutation list");
}
for (Mutation m : entry.getMutations()) {
logSizeEstimate.addAndGet(m.numBytes());
}
}
}
use of org.apache.accumulo.core.client.Durability in project accumulo by apache.
the class DfsLogger method logManyTablets.
public LoggerOperation logManyTablets(List<TabletMutations> mutations) throws IOException {
Durability durability = Durability.NONE;
List<Pair<LogFileKey, LogFileValue>> data = new ArrayList<>();
for (TabletMutations tabletMutations : mutations) {
LogFileKey key = new LogFileKey();
key.event = MANY_MUTATIONS;
key.seq = tabletMutations.getSeq();
key.tid = tabletMutations.getTid();
LogFileValue value = new LogFileValue();
value.mutations = tabletMutations.getMutations();
data.add(new Pair<>(key, value));
if (tabletMutations.getDurability().ordinal() > durability.ordinal()) {
durability = tabletMutations.getDurability();
}
}
return logFileData(data, chooseDurabilityForGroupCommit(mutations));
}
use of org.apache.accumulo.core.client.Durability in project accumulo by apache.
the class TabletServer method getMincEventDurability.
private Durability getMincEventDurability(KeyExtent extent) {
TableConfiguration conf;
if (extent.isMeta()) {
conf = confFactory.getTableConfiguration(RootTable.ID);
} else {
conf = confFactory.getTableConfiguration(MetadataTable.ID);
}
Durability durability = DurabilityImpl.fromString(conf.get(Property.TABLE_DURABILITY));
return durability;
}
Aggregations