Search in sources :

Example 1 with LogSafety

use of com.palantir.atlasdb.protos.generated.TableMetadataPersistence.LogSafety 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);
}
Also used : CachePriority(com.palantir.atlasdb.protos.generated.TableMetadataPersistence.CachePriority) SweepStrategy(com.palantir.atlasdb.protos.generated.TableMetadataPersistence.SweepStrategy) LogSafety(com.palantir.atlasdb.protos.generated.TableMetadataPersistence.LogSafety)

Aggregations

CachePriority (com.palantir.atlasdb.protos.generated.TableMetadataPersistence.CachePriority)1 LogSafety (com.palantir.atlasdb.protos.generated.TableMetadataPersistence.LogSafety)1 SweepStrategy (com.palantir.atlasdb.protos.generated.TableMetadataPersistence.SweepStrategy)1