Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import javax.net.ssl.SSLServerSocket;
import javax.net.ssl.SSLSocket;

import org.apache.thrift.TConfiguration;
import org.apache.thrift.transport.TSSLTransportFactory;
import org.apache.thrift.transport.TServerSocket;
import org.apache.thrift.transport.TSocket;
Expand All @@ -42,8 +43,8 @@
public class HiveAuthUtils {
private static final Logger LOG = LoggerFactory.getLogger(HiveAuthUtils.class);

public static TTransport getSocketTransport(String host, int port, int loginTimeout) {
return new TSocket(host, port, loginTimeout);
public static TTransport getSocketTransport(String host, int port, int loginTimeout) throws TTransportException {
return new TSocket(new TConfiguration(), host, port, loginTimeout);
}

public static TTransport getSSLSocket(String host, int port, int loginTimeout)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,11 +188,11 @@ public Map<String, String> apply(@Nullable Partition partition) {

static String createFunctionObjJson(Function functionObj) throws TException {
TSerializer serializer = new TSerializer(new TJSONProtocol.Factory());
return serializer.toString(functionObj, "UTF-8");
return serializer.toString(functionObj);
}

static String createIndexObjJson(Index indexObj) throws TException {
TSerializer serializer = new TSerializer(new TJSONProtocol.Factory());
return serializer.toString(indexObj, "UTF-8");
return serializer.toString(indexObj);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class MetadataJSONSerializer extends MetadataSerializer {
public String serializeTable(HCatTable hcatTable) throws HCatException {
try {
return new TSerializer(new TJSONProtocol.Factory())
.toString(hcatTable.toHiveTable(), "UTF-8");
.toString(hcatTable.toHiveTable());
}
catch (TException exception) {
throw new HCatException("Could not serialize HCatTable: " + hcatTable, exception);
Expand All @@ -74,7 +74,7 @@ public HCatTable deserializeTable(String hcatTableStringRep) throws HCatExceptio
public String serializePartition(HCatPartition hcatPartition) throws HCatException {
try {
return new TSerializer(new TJSONProtocol.Factory())
.toString(hcatPartition.toHivePartition(), "UTF-8");
.toString(hcatPartition.toHivePartition());
}
catch (TException exception) {
throw new HCatException("Could not serialize HCatPartition: " + hcatPartition, exception);
Expand Down Expand Up @@ -103,7 +103,7 @@ public List<String> serializePartitionSpec(HCatPartitionSpec hcatPartitionSpec)
List<String> stringReps = new ArrayList<String>();
TSerializer serializer = new TSerializer(new TJSONProtocol.Factory());
for (PartitionSpec partitionSpec : hcatPartitionSpec.partitionSpecProxy.toPartitionSpec()) {
stringReps.add(serializer.toString(partitionSpec, "UTF-8"));
stringReps.add(serializer.toString(partitionSpec));
}
return stringReps;
}
Expand Down
Loading