Search in sources :

Example 1 with ColumnFamilyConfiguration

use of com.navercorp.pinpoint.hbase.schema.reader.core.ColumnFamilyConfiguration in project pinpoint by naver.

the class TableCommand method newColumnDescriptor.

private HColumnDescriptor newColumnDescriptor(ColumnFamilyChange columnFamilyChange) {
    HColumnDescriptor hcd = new HColumnDescriptor(columnFamilyChange.getName());
    ColumnFamilyConfiguration columnFamilyConfiguration = columnFamilyChange.getColumnFamilyConfiguration();
    Boolean blockCacheEnabled = columnFamilyConfiguration.getBlockCacheEnabled();
    if (blockCacheEnabled != null) {
        hcd.setBlockCacheEnabled(blockCacheEnabled);
    }
    Integer replicationScope = columnFamilyConfiguration.getReplicationScope();
    if (replicationScope != null) {
        hcd.setScope(replicationScope);
    }
    Boolean inMemory = columnFamilyConfiguration.getInMemory();
    if (inMemory != null) {
        hcd.setInMemory(inMemory);
    }
    Integer timeToLive = columnFamilyConfiguration.getTimeToLive();
    if (timeToLive != null) {
        hcd.setTimeToLive(timeToLive);
    }
    ColumnFamilyConfiguration.DataBlockEncoding dataBlockEncoding = columnFamilyConfiguration.getDataBlockEncoding();
    if (dataBlockEncoding != null) {
        hcd.setDataBlockEncoding(DataBlockEncoding.valueOf(dataBlockEncoding.name()));
    }
    Integer blockSize = columnFamilyConfiguration.getBlockSize();
    if (blockSize != null) {
        hcd.setBlocksize(blockSize);
    }
    Integer maxVersions = columnFamilyConfiguration.getMaxVersions();
    if (maxVersions != null) {
        hcd.setMaxVersions(maxVersions);
    }
    Integer minVersions = columnFamilyConfiguration.getMinVersions();
    if (minVersions != null) {
        hcd.setMinVersions(minVersions);
    }
    ColumnFamilyConfiguration.BloomFilter bloomFilter = columnFamilyConfiguration.getBloomFilter();
    if (bloomFilter != null) {
        hcd.setBloomFilterType(BloomType.valueOf(bloomFilter.name()));
    }
    if (compressionAlgorithm != Compression.Algorithm.NONE) {
        hcd.setCompressionType(compressionAlgorithm);
    }
    return hcd;
}
Also used : HColumnDescriptor(org.apache.hadoop.hbase.HColumnDescriptor) ColumnFamilyConfiguration(com.navercorp.pinpoint.hbase.schema.reader.core.ColumnFamilyConfiguration)

Example 2 with ColumnFamilyConfiguration

use of com.navercorp.pinpoint.hbase.schema.reader.core.ColumnFamilyConfiguration in project pinpoint by naver.

the class ColumnFamilyChangeMapper method mapCreate.

public ColumnFamilyChange mapCreate(Table.CreateColumnFamily createColumnFamily) {
    String name = createColumnFamily.getName();
    if (StringUtils.isEmpty(name)) {
        throw new InvalidHbaseSchemaException("ColumnFamily name must not be empty");
    }
    ColumnFamilyConfiguration columnFamilyConfiguration = columnFamilyConfigurationMapper.mapConfiguration(createColumnFamily.getConfiguration());
    return new CreateColumnFamilyChange(name, columnFamilyConfiguration);
}
Also used : CreateColumnFamilyChange(com.navercorp.pinpoint.hbase.schema.reader.core.CreateColumnFamilyChange) InvalidHbaseSchemaException(com.navercorp.pinpoint.hbase.schema.reader.InvalidHbaseSchemaException) ColumnFamilyConfiguration(com.navercorp.pinpoint.hbase.schema.reader.core.ColumnFamilyConfiguration)

Aggregations

ColumnFamilyConfiguration (com.navercorp.pinpoint.hbase.schema.reader.core.ColumnFamilyConfiguration)2 InvalidHbaseSchemaException (com.navercorp.pinpoint.hbase.schema.reader.InvalidHbaseSchemaException)1 CreateColumnFamilyChange (com.navercorp.pinpoint.hbase.schema.reader.core.CreateColumnFamilyChange)1 HColumnDescriptor (org.apache.hadoop.hbase.HColumnDescriptor)1