Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
flaming-archer committed May 7, 2024
1 parent 992a66c commit 6d3cd6e
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 19 deletions.
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
/**
* Copyright (C) 2016-2024 Expedia, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* <p>
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* <p>
* Unless required by applicable law or agreed to in writing, software distributed under the License
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/
package com.hotels.bdp.waggledance.client;

Expand All @@ -21,6 +19,7 @@
import java.net.URI;
import java.security.PrivilegedExceptionAction;
import java.time.Duration;
import java.util.Objects;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeUnit;

Expand Down Expand Up @@ -76,7 +75,6 @@ void open(HiveUgiArgs ugiArgs) {
return;
}
Exception exception = null;
boolean useSasl = conf.getBoolVar(ConfVars.METASTORE_USE_THRIFT_SASL);
boolean useSsl = conf.getBoolVar(ConfVars.HIVE_METASTORE_USE_SSL);
boolean useCompactProtocol = conf.getBoolVar(ConfVars.METASTORE_USE_THRIFT_COMPACT_PROTOCOL);
int clientSocketTimeout = (int) conf.getTimeVar(ConfVars.METASTORE_CLIENT_SOCKET_TIMEOUT,
Expand Down Expand Up @@ -157,7 +155,7 @@ void open(HiveUgiArgs ugiArgs) {
} else {
log.debug("Connection opened with out #set_ugi call', on URI {}", store);
}
} catch (TException |IOException | ExecutionException e) {
} catch (TException | IOException | ExecutionException e) {
exception = e;
if (log.isDebugEnabled()) {
log.warn("Failed to connect to the MetaStore Server, URI " + store, e);
Expand Down Expand Up @@ -204,6 +202,24 @@ public DelegationTokenKey(String msUri, String username, Iface client) {
this.username = username;
this.client = client;
}

@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
DelegationTokenKey that = (DelegationTokenKey) o;
return Objects.equals(msUri, that.msUri) && Objects.equals(username,
that.username);
}

@Override
public int hashCode() {
return Objects.hash(msUri, username);
}
}

private static String loadDelegationToken(DelegationTokenKey key) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,12 +173,6 @@ private void startWaggleDance(
serverSocket = new TServerSocketKeepAlive(serverSocket);
}

if(useSasl) {
UserGroupInformation.setConfiguration(hiveConf);
// saslServerAndMDT = SaslHelper.createSaslServer(hiveConf);
// saslServer = saslServerAndMDT.getSaslServer();
}

TTransportFactory transFactory = createTTransportFactory(useFramedTransport, useSasl,
saslServerWrapper.getSaslServer());
TProcessorFactory tProcessorFactory = getTProcessorFactory(useSasl, saslServerWrapper.getSaslServer());
Expand Down

0 comments on commit 6d3cd6e

Please sign in to comment.