This is an automated email from the ASF dual-hosted git repository.

pinal pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/atlas.git


The following commit(s) were added to refs/heads/master by this push:
     new ab89e78ed ATLAS-4817 : Change compression from 'GZ' to 'SNAPPY' in 
Atlas HBase tables
ab89e78ed is described below

commit ab89e78ed5737acbee409203d20c75bc10429b9d
Author: vinayak.marraiya <vinayak.marra...@cloudera.com>
AuthorDate: Mon Dec 11 14:58:54 2023 +0530

    ATLAS-4817 : Change compression from 'GZ' to 'SNAPPY' in Atlas HBase tables
    
    Signed-off-by: Pinal Shah <pinal.s...@freestoneinfotech.com>
---
 .../java/org/janusgraph/diskstorage/hbase2/HBaseStoreManager.java   | 6 ++++--
 .../apache/atlas/repository/audit/HBaseBasedAuditRepository.java    | 2 +-
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git 
a/graphdb/janus-hbase2/src/main/java/org/janusgraph/diskstorage/hbase2/HBaseStoreManager.java
 
b/graphdb/janus-hbase2/src/main/java/org/janusgraph/diskstorage/hbase2/HBaseStoreManager.java
index f98fa7b76..5f8e31021 100644
--- 
a/graphdb/janus-hbase2/src/main/java/org/janusgraph/diskstorage/hbase2/HBaseStoreManager.java
+++ 
b/graphdb/janus-hbase2/src/main/java/org/janusgraph/diskstorage/hbase2/HBaseStoreManager.java
@@ -36,6 +36,7 @@ import org.apache.hadoop.hbase.client.Mutation;
 import org.apache.hadoop.hbase.client.Put;
 import org.apache.hadoop.hbase.client.Row;
 import org.apache.hadoop.hbase.client.TableDescriptor;
+import org.apache.hadoop.hbase.io.encoding.DataBlockEncoding;
 import org.apache.hadoop.hbase.util.Bytes;
 import org.apache.hadoop.hbase.util.Pair;
 import org.apache.hadoop.hbase.util.VersionInfo;
@@ -114,7 +115,7 @@ public class HBaseStoreManager extends 
DistributedStoreManager implements KeyCol
             "An HBase Compression.Algorithm enum string which will be applied 
to newly created column families. " +
             "The compression algorithm must be installed and available on the 
HBase cluster.  JanusGraph cannot install " +
             "and configure new compression algorithms on the HBase cluster by 
itself.",
-            ConfigOption.Type.MASKABLE, "GZ");
+            ConfigOption.Type.MASKABLE, "SNAPPY");
 
     public static final ConfigOption<Boolean> SKIP_SCHEMA_CHECK =
             new ConfigOption<>(HBASE_NS, "skip-schema-check",
@@ -820,7 +821,7 @@ public class HBaseStoreManager extends 
DistributedStoreManager implements KeyCol
                 try {
                     ColumnFamilyDescriptor cdesc = 
ColumnFamilyDescriptorBuilder.of(columnFamily);
 
-                    setCFOptions(cdesc, ttlInSeconds);
+                    cdesc = setCFOptions(cdesc, ttlInSeconds);
 
                     adm.addColumn(tableName, cdesc);
 
@@ -850,6 +851,7 @@ public class HBaseStoreManager extends 
DistributedStoreManager implements KeyCol
         ColumnFamilyDescriptor ret = null;
 
         if (null != compression && !compression.equals(COMPRESSION_DEFAULT)) {
+            cdesc = 
ColumnFamilyDescriptorBuilder.newBuilder(cdesc).setDataBlockEncoding( 
DataBlockEncoding.FAST_DIFF).build();
             ret = compat.setCompression(cdesc, compression);
         }
 
diff --git 
a/repository/src/main/java/org/apache/atlas/repository/audit/HBaseBasedAuditRepository.java
 
b/repository/src/main/java/org/apache/atlas/repository/audit/HBaseBasedAuditRepository.java
index b7f0dd5e2..9161cc8ff 100644
--- 
a/repository/src/main/java/org/apache/atlas/repository/audit/HBaseBasedAuditRepository.java
+++ 
b/repository/src/main/java/org/apache/atlas/repository/audit/HBaseBasedAuditRepository.java
@@ -774,7 +774,7 @@ public class HBaseBasedAuditRepository extends 
AbstractStorageBasedAuditReposito
                 HColumnDescriptor columnFamily = new 
HColumnDescriptor(COLUMN_FAMILY);
                 columnFamily.setMaxVersions(1);
                 columnFamily.setDataBlockEncoding(DataBlockEncoding.FAST_DIFF);
-                columnFamily.setCompressionType(Compression.Algorithm.GZ);
+                columnFamily.setCompressionType(Compression.Algorithm.SNAPPY);
                 columnFamily.setBloomFilterType(BloomType.ROW);
                 tableDescriptor.addFamily(columnFamily);
                 admin.createTable(tableDescriptor);

Reply via email to