use of com.palantir.atlasdb.protos.generated.TableMetadataPersistence.CachePriority in project atlasdb by palantir.
the class TableMetadata method hydrateFromProto.
public static TableMetadata hydrateFromProto(TableMetadataPersistence.TableMetadata message) {
CachePriority cachePriority = CachePriority.WARM;
if (message.hasCachePriority()) {
cachePriority = message.getCachePriority();
}
boolean rangeScanAllowed = false;
if (message.hasRangeScanAllowed()) {
rangeScanAllowed = message.getRangeScanAllowed();
}
int explicitCompressionBlockSizeKB = 0;
if (message.hasExplicitCompressionBlockSizeKiloBytes()) {
explicitCompressionBlockSizeKB = message.getExplicitCompressionBlockSizeKiloBytes();
}
boolean negativeLookups = false;
if (message.hasNegativeLookups()) {
negativeLookups = message.getNegativeLookups();
}
SweepStrategy sweepStrategy = SweepStrategy.CONSERVATIVE;
if (message.hasSweepStrategy()) {
sweepStrategy = message.getSweepStrategy();
}
boolean appendHeavyAndReadLight = false;
if (message.hasAppendHeavyAndReadLight()) {
appendHeavyAndReadLight = message.getAppendHeavyAndReadLight();
}
LogSafety nameLogSafety = LogSafety.UNSAFE;
if (message.hasNameLogSafety()) {
nameLogSafety = message.getNameLogSafety();
}
return new TableMetadata(NameMetadataDescription.hydrateFromProto(message.getRowName()), ColumnMetadataDescription.hydrateFromProto(message.getColumns()), ConflictHandlers.hydrateFromProto(message.getConflictHandler()), cachePriority, rangeScanAllowed, explicitCompressionBlockSizeKB, negativeLookups, sweepStrategy, appendHeavyAndReadLight, nameLogSafety);
}
Aggregations