You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@phoenix.apache.org by st...@apache.org on 2024/02/29 08:46:31 UTC
(phoenix-omid) branch master updated: OMID-277 Omid 1.1.2 fails with Phoenix 5.2
This is an automated email from the ASF dual-hosted git repository.
stoty pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/phoenix-omid.git
The following commit(s) were added to refs/heads/master by this push:
new 91260e35 OMID-277 Omid 1.1.2 fails with Phoenix 5.2
91260e35 is described below
commit 91260e355d0e6c004420eef6cead2cda3dbc8971
Author: Istvan Toth <st...@apache.org>
AuthorDate: Thu Feb 29 07:22:13 2024 +0100
OMID-277 Omid 1.1.2 fails with Phoenix 5.2
* remove overlooked unrelecated Guava references
* add maven enforcer plugin to catch future problems
---
.../org/apache/omid/transaction/HBaseCellId.java | 2 +-
.../org/apache/omid/transaction/TestCellUtils.java | 28 ++++-----
.../apache/omid/transaction/TestOmidLLRaces.java | 2 +-
.../apache/omid/transaction/TestShadowCells.java | 2 +-
.../committable/hbase/HBaseCommitTableConfig.java | 2 +-
pom.xml | 67 ++++++++++++++++++++++
.../timestamp/storage/HBaseTimestampStorage.java | 2 +-
.../omid/tso/client/TestUnconnectedTSOClient.java | 2 +-
8 files changed, 87 insertions(+), 20 deletions(-)
diff --git a/hbase-client/src/main/java/org/apache/omid/transaction/HBaseCellId.java b/hbase-client/src/main/java/org/apache/omid/transaction/HBaseCellId.java
index 7c21bc8e..736ab3dc 100644
--- a/hbase-client/src/main/java/org/apache/omid/transaction/HBaseCellId.java
+++ b/hbase-client/src/main/java/org/apache/omid/transaction/HBaseCellId.java
@@ -17,7 +17,7 @@
*/
package org.apache.omid.transaction;
-import static com.google.common.base.Charsets.UTF_8;
+import static org.apache.phoenix.thirdparty.com.google.common.base.Charsets.UTF_8;
import org.apache.omid.tso.client.CellId;
diff --git a/hbase-client/src/test/java/org/apache/omid/transaction/TestCellUtils.java b/hbase-client/src/test/java/org/apache/omid/transaction/TestCellUtils.java
index 50a4a9ba..d5a162fd 100644
--- a/hbase-client/src/test/java/org/apache/omid/transaction/TestCellUtils.java
+++ b/hbase-client/src/test/java/org/apache/omid/transaction/TestCellUtils.java
@@ -57,13 +57,13 @@ public class TestCellUtils {
public void testShadowCellQualifiers(byte[] shadowCellSuffixToTest) throws IOException {
final byte[] validShadowCellQualifier =
- com.google.common.primitives.Bytes.concat(qualifier, shadowCellSuffixToTest);
+ org.apache.phoenix.thirdparty.com.google.common.primitives.Bytes.concat(qualifier, shadowCellSuffixToTest);
final byte[] sandwichValidShadowCellQualifier =
- com.google.common.primitives.Bytes.concat(shadowCellSuffixToTest, validShadowCellQualifier);
+ org.apache.phoenix.thirdparty.com.google.common.primitives.Bytes.concat(shadowCellSuffixToTest, validShadowCellQualifier);
final byte[] doubleEndedValidShadowCellQualifier =
- com.google.common.primitives.Bytes.concat(validShadowCellQualifier, shadowCellSuffixToTest);
+ org.apache.phoenix.thirdparty.com.google.common.primitives.Bytes.concat(validShadowCellQualifier, shadowCellSuffixToTest);
final byte[] interleavedValidShadowCellQualifier =
- com.google.common.primitives.Bytes.concat(validShadowCellQualifier, com.google.common.primitives.Bytes
+ org.apache.phoenix.thirdparty.com.google.common.primitives.Bytes.concat(validShadowCellQualifier, org.apache.phoenix.thirdparty.com.google.common.primitives.Bytes
.concat(validShadowCellQualifier, validShadowCellQualifier));
final byte[] value = Bytes.toBytes("test-value");
@@ -100,11 +100,11 @@ public class TestCellUtils {
public void testCorrectMapingOfCellsToShadowCells() throws IOException {
// Create the required data
final byte[] validShadowCellQualifier =
- com.google.common.primitives.Bytes.concat(SHADOW_CELL_PREFIX, qualifier, SHADOW_CELL_SUFFIX);
+ org.apache.phoenix.thirdparty.com.google.common.primitives.Bytes.concat(SHADOW_CELL_PREFIX, qualifier, SHADOW_CELL_SUFFIX);
final byte[] qualifier2 = Bytes.toBytes("test-qual2");
final byte[] validShadowCellQualifier2 =
- com.google.common.primitives.Bytes.concat(SHADOW_CELL_PREFIX, qualifier2, SHADOW_CELL_SUFFIX);
+ org.apache.phoenix.thirdparty.com.google.common.primitives.Bytes.concat(SHADOW_CELL_PREFIX, qualifier2, SHADOW_CELL_SUFFIX);
final byte[] qualifier3 = Bytes.toBytes("test-qual3");
@@ -176,7 +176,7 @@ public class TestCellUtils {
byte[] suffixedQualifier = CellUtils.addShadowCellSuffixPrefix(cell.getQualifierArray(),
cell.getQualifierOffset(),
cell.getQualifierLength());
- byte[] expectedQualifier = com.google.common.primitives.Bytes.concat(SHADOW_CELL_PREFIX, qualifier, SHADOW_CELL_SUFFIX);
+ byte[] expectedQualifier = org.apache.phoenix.thirdparty.com.google.common.primitives.Bytes.concat(SHADOW_CELL_PREFIX, qualifier, SHADOW_CELL_SUFFIX);
assertEquals(suffixedQualifier, expectedQualifier);
}
@@ -185,7 +185,7 @@ public class TestCellUtils {
public void testShadowCellSuffixRemovalFromQualifier(byte[] shadowCellSuffixToTest) throws IOException {
// Test removal from a correclty suffixed qualifier
- byte[] suffixedQualifier = com.google.common.primitives.Bytes.concat(SHADOW_CELL_PREFIX, qualifier, shadowCellSuffixToTest);
+ byte[] suffixedQualifier = org.apache.phoenix.thirdparty.com.google.common.primitives.Bytes.concat(SHADOW_CELL_PREFIX, qualifier, shadowCellSuffixToTest);
Cell cell = new KeyValue(row, family, suffixedQualifier, 1, Bytes.toBytes("value"));
byte[] resultedQualifier = CellUtils.removeShadowCellSuffixPrefix(cell.getQualifierArray(),
cell.getQualifierOffset(),
@@ -194,7 +194,7 @@ public class TestCellUtils {
assertEquals(resultedQualifier, expectedQualifier);
// Test removal from a badly suffixed qualifier
- byte[] badlySuffixedQualifier = com.google.common.primitives.Bytes.concat(SHADOW_CELL_PREFIX, qualifier, Bytes.toBytes("BAD"));
+ byte[] badlySuffixedQualifier = org.apache.phoenix.thirdparty.com.google.common.primitives.Bytes.concat(SHADOW_CELL_PREFIX, qualifier, Bytes.toBytes("BAD"));
Cell badCell = new KeyValue(row, family, badlySuffixedQualifier, 1, Bytes.toBytes("value"));
try {
CellUtils.removeShadowCellSuffixPrefix(badCell.getQualifierArray(),
@@ -216,7 +216,7 @@ public class TestCellUtils {
@Test(dataProvider = "shadow-cell-suffixes", timeOut = 10_000)
public void testQualifierLengthFromShadowCellQualifier(byte[] shadowCellSuffixToTest) {
// Test suffixed qualifier
- byte[] suffixedQualifier = com.google.common.primitives.Bytes.concat(SHADOW_CELL_PREFIX, qualifier, shadowCellSuffixToTest);
+ byte[] suffixedQualifier = org.apache.phoenix.thirdparty.com.google.common.primitives.Bytes.concat(SHADOW_CELL_PREFIX, qualifier, shadowCellSuffixToTest);
int originalQualifierLength =
CellUtils.qualifierLengthFromShadowCellQualifier(suffixedQualifier, 0, suffixedQualifier.length);
assertEquals(originalQualifierLength, qualifier.length);
@@ -232,20 +232,20 @@ public class TestCellUtils {
public void testmapCellsToShadowCellsCellOrder() {
// Create the required data
final byte[] validShadowCellQualifier =
- com.google.common.primitives.Bytes.concat(SHADOW_CELL_PREFIX, qualifier, SHADOW_CELL_SUFFIX);
+ org.apache.phoenix.thirdparty.com.google.common.primitives.Bytes.concat(SHADOW_CELL_PREFIX, qualifier, SHADOW_CELL_SUFFIX);
final byte[] qualifier2 = Bytes.toBytes("test-qual2");
final byte[] validShadowCellQualifier2 =
- com.google.common.primitives.Bytes.concat(SHADOW_CELL_PREFIX, qualifier2, SHADOW_CELL_SUFFIX);
+ org.apache.phoenix.thirdparty.com.google.common.primitives.Bytes.concat(SHADOW_CELL_PREFIX, qualifier2, SHADOW_CELL_SUFFIX);
final byte[] qualifier3 = Bytes.toBytes("test-qual3");
final byte[] validShadowCellQualifier3 =
- com.google.common.primitives.Bytes.concat(SHADOW_CELL_PREFIX, qualifier3, SHADOW_CELL_SUFFIX);
+ org.apache.phoenix.thirdparty.com.google.common.primitives.Bytes.concat(SHADOW_CELL_PREFIX, qualifier3, SHADOW_CELL_SUFFIX);
final byte[] qualifier4 = Bytes.toBytes("test-qual4");
final byte[] qualifier5 = Bytes.toBytes("test-qual5");
final byte[] validShadowCellQualifier5 =
- com.google.common.primitives.Bytes.concat(SHADOW_CELL_PREFIX, qualifier5, SHADOW_CELL_SUFFIX);
+ org.apache.phoenix.thirdparty.com.google.common.primitives.Bytes.concat(SHADOW_CELL_PREFIX, qualifier5, SHADOW_CELL_SUFFIX);
Cell cell1 = new KeyValue(row, family, qualifier, 1, Bytes.toBytes("value")); // Default type is Put
diff --git a/hbase-client/src/test/java/org/apache/omid/transaction/TestOmidLLRaces.java b/hbase-client/src/test/java/org/apache/omid/transaction/TestOmidLLRaces.java
index 7d2fa76b..b6bd2d0c 100644
--- a/hbase-client/src/test/java/org/apache/omid/transaction/TestOmidLLRaces.java
+++ b/hbase-client/src/test/java/org/apache/omid/transaction/TestOmidLLRaces.java
@@ -18,7 +18,7 @@
package org.apache.omid.transaction;
-import static com.google.common.base.Charsets.UTF_8;
+import static org.apache.phoenix.thirdparty.com.google.common.base.Charsets.UTF_8;
import static org.apache.hadoop.hbase.HConstants.HBASE_CLIENT_RETRIES_NUMBER;
import static org.apache.omid.committable.hbase.HBaseCommitTableConfig.DEFAULT_COMMIT_TABLE_CF_NAME;
import static org.mockito.Mockito.spy;
diff --git a/hbase-client/src/test/java/org/apache/omid/transaction/TestShadowCells.java b/hbase-client/src/test/java/org/apache/omid/transaction/TestShadowCells.java
index f73283d7..5e3f8926 100644
--- a/hbase-client/src/test/java/org/apache/omid/transaction/TestShadowCells.java
+++ b/hbase-client/src/test/java/org/apache/omid/transaction/TestShadowCells.java
@@ -536,7 +536,7 @@ public class TestShadowCells extends OmidTestBase {
private static final byte[] LEGACY_SHADOW_CELL_SUFFIX = ":OMID_CTS".getBytes(Charsets.UTF_8);
private static byte[] addLegacyShadowCellSuffix(byte[] qualifier) {
- return com.google.common.primitives.Bytes.concat(qualifier, LEGACY_SHADOW_CELL_SUFFIX);
+ return org.apache.phoenix.thirdparty.com.google.common.primitives.Bytes.concat(qualifier, LEGACY_SHADOW_CELL_SUFFIX);
}
}
diff --git a/hbase-commit-table/src/main/java/org/apache/omid/committable/hbase/HBaseCommitTableConfig.java b/hbase-commit-table/src/main/java/org/apache/omid/committable/hbase/HBaseCommitTableConfig.java
index b2ff0ab2..9e66c8b4 100644
--- a/hbase-commit-table/src/main/java/org/apache/omid/committable/hbase/HBaseCommitTableConfig.java
+++ b/hbase-commit-table/src/main/java/org/apache/omid/committable/hbase/HBaseCommitTableConfig.java
@@ -21,7 +21,7 @@ import com.google.inject.Inject;
import com.google.inject.name.Named;
import org.apache.hadoop.hbase.util.Bytes;
-import static com.google.common.base.Charsets.UTF_8;
+import static org.apache.phoenix.thirdparty.com.google.common.base.Charsets.UTF_8;
public class HBaseCommitTableConfig {
diff --git a/pom.xml b/pom.xml
index 68aca3b8..0e577cd8 100644
--- a/pom.xml
+++ b/pom.xml
@@ -196,6 +196,7 @@
<maven-jxr-plugin.version>3.3.0</maven-jxr-plugin.version>
<maven-findbugs-maven-plugin.version>3.0.5</maven-findbugs-maven-plugin.version>
<maven-owasp-plugin.version>8.4.0</maven-owasp-plugin.version>
+ <restrict-imports.enforcer.version>2.4.0</restrict-imports.enforcer.version>
<!-- Code coverage properties -->
<maven-clover-plugin.version>4.5.0</maven-clover-plugin.version>
@@ -293,6 +294,67 @@
</configuration>
</plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-enforcer-plugin</artifactId>
+ <dependencies>
+ <dependency>
+ <groupId>de.skuzzle.enforcer</groupId>
+ <artifactId>restrict-imports-enforcer-rule</artifactId>
+ <version>${restrict-imports.enforcer.version}</version>
+ </dependency>
+ </dependencies>
+ <executions>
+ <execution>
+ <id>banned-illegal-imports</id>
+ <phase>process-sources</phase>
+ <goals>
+ <goal>enforce</goal>
+ </goals>
+ <configuration>
+ <rules>
+ <RestrictImports>
+ <includeTestCode>true</includeTestCode>
+ <reason>Use SLF4j for logging</reason>
+ <bannedImports>
+ <bannedImport>org.apache.commons.logging.Log</bannedImport>
+ <bannedImport>org.apache.commons.logging.LogFactory</bannedImport>
+ </bannedImports>
+ </RestrictImports>
+ <RestrictImports>
+ <includeTestCode>true</includeTestCode>
+ <reason>Use shaded version in phoenix-thirdparty</reason>
+ <bannedImports>
+ <bannedImport>com.google.common.**</bannedImport>
+ </bannedImports>
+ </RestrictImports>
+ <RestrictImports>
+ <includeTestCode>true</includeTestCode>
+ <reason>Use shaded version in phoenix-thirdparty</reason>
+ <bannedImports>
+ <bannedImport>org.apache.commons.cli.**</bannedImport>
+ </bannedImports>
+ </RestrictImports>
+ <RestrictImports>
+ <includeTestCode>true</includeTestCode>
+ <reason>Use commons lang 3</reason>
+ <bannedImports>
+ <bannedImport>org.apache.commons.lang.**</bannedImport>
+ </bannedImports>
+ </RestrictImports>
+ <RestrictImports>
+ <includeTestCode>true</includeTestCode>
+ <reason>Use edu.umd.cs.findbugs.annotations</reason>
+ <bannedImports>
+ <bannedImport>com.sun.istack.**</bannedImport>
+ </bannedImports>
+ </RestrictImports>
+ </rules>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
<!-- ============================================================================================== -->
<!-- Code coverage plugins -->
<!-- ============================================================================================== -->
@@ -389,6 +451,11 @@
<artifactId>cobertura-maven-plugin</artifactId>
</plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-enforcer-plugin</artifactId>
+ </plugin>
+
<!-- ============================================================================================== -->
<!-- License Management plugins -->
<!-- ============================================================================================== -->
diff --git a/timestamp-storage/src/main/java/org/apache/omid/timestamp/storage/HBaseTimestampStorage.java b/timestamp-storage/src/main/java/org/apache/omid/timestamp/storage/HBaseTimestampStorage.java
index 43de55a8..d5da5f3d 100644
--- a/timestamp-storage/src/main/java/org/apache/omid/timestamp/storage/HBaseTimestampStorage.java
+++ b/timestamp-storage/src/main/java/org/apache/omid/timestamp/storage/HBaseTimestampStorage.java
@@ -17,7 +17,7 @@
*/
package org.apache.omid.timestamp.storage;
-import static com.google.common.base.Charsets.UTF_8;
+import static org.apache.phoenix.thirdparty.com.google.common.base.Charsets.UTF_8;
import java.io.IOException;
diff --git a/tso-server/src/test/java/org/apache/omid/tso/client/TestUnconnectedTSOClient.java b/tso-server/src/test/java/org/apache/omid/tso/client/TestUnconnectedTSOClient.java
index 3c1f273f..8c69cf17 100644
--- a/tso-server/src/test/java/org/apache/omid/tso/client/TestUnconnectedTSOClient.java
+++ b/tso-server/src/test/java/org/apache/omid/tso/client/TestUnconnectedTSOClient.java
@@ -25,7 +25,7 @@ import org.testng.annotations.Test;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeUnit;
-import static com.google.common.collect.Sets.newHashSet;
+import static org.apache.phoenix.thirdparty.com.google.common.collect.Sets.newHashSet;
import static org.slf4j.LoggerFactory.getLogger;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.fail;