This is an automated email from the ASF dual-hosted git repository.
ctubbsii pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/accumulo-proxy.git
The following commit(s) were added to refs/heads/main by this push:
new 4155a74 Fix some usages of deprecation (#61)
4155a74 is described below
commit 4155a7418bcecc52b91bfef7e5e67120dd26e427
Author: Dom G <[email protected]>
AuthorDate: Tue Jan 17 16:50:15 2023 -0500
Fix some usages of deprecation (#61)
---
src/main/java/org/apache/accumulo/proxy/Proxy.java | 2 +-
src/main/java/org/apache/accumulo/proxy/ProxyServer.java | 9 +++++----
2 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/src/main/java/org/apache/accumulo/proxy/Proxy.java
b/src/main/java/org/apache/accumulo/proxy/Proxy.java
index da31732..26e6dec 100644
--- a/src/main/java/org/apache/accumulo/proxy/Proxy.java
+++ b/src/main/java/org/apache/accumulo/proxy/Proxy.java
@@ -159,7 +159,7 @@ public class Proxy implements KeywordExecutable {
.forName(
proxyProps.getProperty("protocolFactory",
TCompactProtocol.Factory.class.getName()))
.asSubclass(TProtocolFactory.class);
- TProtocolFactory protoFactory = protoFactoryClass.newInstance();
+ TProtocolFactory protoFactory =
protoFactoryClass.getDeclaredConstructor().newInstance();
int port = Integer.parseInt(proxyProps.getProperty("port"));
String hostname = proxyProps.getProperty(THRIFT_SERVER_HOSTNAME,
THRIFT_SERVER_HOSTNAME_DEFAULT);
diff --git a/src/main/java/org/apache/accumulo/proxy/ProxyServer.java
b/src/main/java/org/apache/accumulo/proxy/ProxyServer.java
index e21b990..92e363d 100644
--- a/src/main/java/org/apache/accumulo/proxy/ProxyServer.java
+++ b/src/main/java/org/apache/accumulo/proxy/ProxyServer.java
@@ -18,6 +18,7 @@ package org.apache.accumulo.proxy;
import static java.nio.charset.StandardCharsets.UTF_8;
+import java.lang.reflect.InvocationTargetException;
import java.nio.ByteBuffer;
import java.util.ArrayList;
import java.util.Collection;
@@ -802,7 +803,7 @@ public class ProxyServer implements AccumuloProxy.Iface {
pscan.type = ScanType.valueOf(scan.getType().toString());
pscan.state = ScanState.valueOf(scan.getState().toString());
TabletId e = scan.getTablet();
- pscan.extent = new
org.apache.accumulo.proxy.thrift.KeyExtent(e.getTableId().toString(),
+ pscan.extent = new
org.apache.accumulo.proxy.thrift.KeyExtent(e.getTable().toString(),
TextUtil.getByteBuffer(e.getEndRow()),
TextUtil.getByteBuffer(e.getPrevEndRow()));
pscan.columns = new ArrayList<>();
if (scan.getColumns() != null) {
@@ -856,7 +857,7 @@ public class ProxyServer implements AccumuloProxy.Iface {
pcomp.entriesRead = comp.getEntriesRead();
pcomp.entriesWritten = comp.getEntriesWritten();
TabletId e = comp.getTablet();
- pcomp.extent = new
org.apache.accumulo.proxy.thrift.KeyExtent(e.getTableId().toString(),
+ pcomp.extent = new
org.apache.accumulo.proxy.thrift.KeyExtent(e.getTable().toString(),
TextUtil.getByteBuffer(e.getEndRow()),
TextUtil.getByteBuffer(e.getPrevEndRow()));
pcomp.inputFiles = new ArrayList<>();
if (comp.getInputFiles() != null) {
@@ -2078,8 +2079,8 @@ public class ProxyServer implements AccumuloProxy.Iface {
props.putAllStrings(properties);
AuthenticationToken token;
try {
- token = tokenClass.newInstance();
- } catch (InstantiationException | IllegalAccessException e) {
+ token = tokenClass.getDeclaredConstructor().newInstance();
+ } catch (ReflectiveOperationException e) {
logger.error("Error constructing authentication token", e);
throw new AccumuloException(e);
}