[
https://issues.apache.org/jira/browse/PHOENIX-1250?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14135745#comment-14135745
]
Sean Busbey commented on PHOENIX-1250:
--------------------------------------
Which branch is this against? I can't apply it to master or 4.0.
{noformat}
diff --git a/phoenix-core/pom.xml b/phoenix-core/pom.xml
index d5774ea..eb1004b 100644
--- a/phoenix-core/pom.xml
+++ b/phoenix-core/pom.xml
@@ -325,6 +325,10 @@
<groupId>org.apache.commons</groupId>
<artifactId>commons-csv</artifactId>
</dependency>
+ <dependency>
+ <groupId>com.google.code.findbugs</groupId>
+ <artifactId>jsr305</artifactId>
+ </dependency>
</dependencies>
{noformat}
This is because you used @Nullable on the IOException param to the
reimplementation of Closeables.closeQuietly, right?
It looks like there are already classes using the Nullable annotation in
phoenix-core while relying on the jsr305 jar to get pulled in by guava. Looks
like they stopped listing it? We should file a follow on to check in general
for unlisted dependencies project-wide.
{noformat}
diff --git
a/phoenix-flume/src/main/java/org/apache/phoenix/flume/sink/PhoenixSink.java
b/phoenix-flume/src/main/java/org/apache/phoenix/flume/sink/PhoenixSink.java
index efcbef6..0e07f35 100644
--- a/phoenix-flume/src/main/java/org/apache/phoenix/flume/sink/PhoenixSink.java
+++ b/phoenix-flume/src/main/java/org/apache/phoenix/flume/sink/PhoenixSink.java
@@ -140,7 +140,7 @@ public final class PhoenixSink extends AbstractSink
implements Configurable {
Channel channel = getChannel();
Transaction transaction = null;
List<Event> events =
Lists.newArrayListWithExpectedSize(this.batchSize);
- Stopwatch watch = new Stopwatch().start();
+ long startTime = System.currentTimeMillis();
try {
transaction = channel.getTransaction();
transaction.begin();
@@ -194,7 +194,8 @@ public final class PhoenixSink extends AbstractSink
implements Configurable {
throw new EventDeliveryException("Failed to persist message", e);
}
finally {
- logger.error(String.format("Time taken to process [%s] events was
[%s] seconds",events.size(),watch.stop().elapsedTime(TimeUnit.SECONDS)));
+ logger.error(String.format("Time taken to process [%s] events was
[%s] seconds",
+ events.size(),(System.currentTimeMillis() - startTime) /
1000L));
if( transaction != null ) {
transaction.close();
}
{noformat}
Is preemptive because StopWatch is marked @Beta? AFAICT it's in the current
javadocs.
Since this is an elapsed time measurement, it should probably be
System.nanoTime instead of cTM.
It doesn't look like the patch removed the import of Stopwatch from PhoenixSink.
> guava dependency out-dated causing NoSuchMethod error
> -----------------------------------------------------
>
> Key: PHOENIX-1250
> URL: https://issues.apache.org/jira/browse/PHOENIX-1250
> Project: Phoenix
> Issue Type: Bug
> Affects Versions: 4.1
> Environment: CentOS, Phoenix 4.1, HBase 0.98.5
> Reporter: Jerry Chabot
> Assignee: Gabriel Reid
> Attachments: PHOENIX-1250.patch
>
>
> Phoenix has a dependency on Guava 12.0.1 (released in 2012). My project uses
> Guava 16.0.1. The latest version is 18. Apparently, the
> Closeables.closeQuitely(Closeable) no longer exists in 16.0.1 and later.
> Possibly earlier versions.
> I get the error below when attempting to get a connection. This is blocking
> any attempts to integrate Phoenix because I cannot downgrade our project
> dependency to a 2 year old version.
> Please review all project dependencies and consider uprading to more recent
> versions.
> java.sql.SQLException: java.lang.NoSuchMethodError:
> com.google.common.io.Closeables.closeQuietly(Ljava/io/Closeable;)V
> at
> org.apache.phoenix.query.ConnectionQueryServicesImpl.metaDataCoprocessorExec(ConnectionQueryServicesImpl.java:947)
> at
> org.apache.phoenix.query.ConnectionQueryServicesImpl.createTable(ConnectionQueryServicesImpl.java:1144)
> at
> org.apache.phoenix.query.DelegateConnectionQueryServices.createTable(DelegateConnectionQueryServices.java:114)
> at
> org.apache.phoenix.schema.MetaDataClient.createTableInternal(MetaDataClient.java:1315)
> at
> org.apache.phoenix.schema.MetaDataClient.createTable(MetaDataClient.java:445)
> at
> org.apache.phoenix.compile.CreateTableCompiler$2.execute(CreateTableCompiler.java:183)
> at
> org.apache.phoenix.jdbc.PhoenixStatement$2.call(PhoenixStatement.java:256)
> at
> org.apache.phoenix.jdbc.PhoenixStatement$2.call(PhoenixStatement.java:248)
> at org.apache.phoenix.call.CallRunner.run(CallRunner.java:53)
> at
> org.apache.phoenix.jdbc.PhoenixStatement.executeMutation(PhoenixStatement.java:246)
> at
> org.apache.phoenix.jdbc.PhoenixStatement.executeUpdate(PhoenixStatement.java:960)
> at
> org.apache.phoenix.query.ConnectionQueryServicesImpl$9.call(ConnectionQueryServicesImpl.java:1519)
> at
> org.apache.phoenix.query.ConnectionQueryServicesImpl$9.call(ConnectionQueryServicesImpl.java:1489)
> at
> org.apache.phoenix.util.PhoenixContextExecutor.call(PhoenixContextExecutor.java:77)
> at
> org.apache.phoenix.query.ConnectionQueryServicesImpl.init(ConnectionQueryServicesImpl.java:1489)
> at
> org.apache.phoenix.jdbc.PhoenixDriver.getConnectionQueryServices(PhoenixDriver.java:162)
> at
> org.apache.phoenix.jdbc.PhoenixEmbeddedDriver.connect(PhoenixEmbeddedDriver.java:129)
> at org.apache.phoenix.jdbc.PhoenixDriver.connect(PhoenixDriver.java:133)
> at java.sql.DriverManager.getConnection(DriverManager.java:571)
> at java.sql.DriverManager.getConnection(DriverManager.java:187)
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)