Repository: tajo Updated Branches: refs/heads/master 8f38cc7b7 -> 67bdc71b1
TAJO-1195: Remove unused CachedDNSResolver Class. (DaeMyung Kang via jaehwa) Closes #253 Project: http://git-wip-us.apache.org/repos/asf/tajo/repo Commit: http://git-wip-us.apache.org/repos/asf/tajo/commit/67bdc71b Tree: http://git-wip-us.apache.org/repos/asf/tajo/tree/67bdc71b Diff: http://git-wip-us.apache.org/repos/asf/tajo/diff/67bdc71b Branch: refs/heads/master Commit: 67bdc71b17b54da731eaf01b9fac51ad8983353b Parents: 8f38cc7 Author: JaeHwa Jung <[email protected]> Authored: Wed Nov 19 15:46:47 2014 +0900 Committer: JaeHwa Jung <[email protected]> Committed: Wed Nov 19 15:48:43 2014 +0900 ---------------------------------------------------------------------- CHANGES | 2 + .../org/apache/tajo/net/CachedDNSResolver.java | 64 -------------------- 2 files changed, 2 insertions(+), 64 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/tajo/blob/67bdc71b/CHANGES ---------------------------------------------------------------------- diff --git a/CHANGES b/CHANGES index 01ffbb2..1ace332 100644 --- a/CHANGES +++ b/CHANGES @@ -13,6 +13,8 @@ Release 0.9.1 - unreleased IMPROVEMENT + TAJO-1195: Remove unused CachedDNSResolver Class. (DaeMyung Kang via jaehwa) + TAJO-1184: Upgrade netty-buffer to 4.0.24.Final. (jinho) TAJO-1156: Improve the comparison of timestamp and date types. http://git-wip-us.apache.org/repos/asf/tajo/blob/67bdc71b/tajo-core/src/main/java/org/apache/tajo/net/CachedDNSResolver.java ---------------------------------------------------------------------- diff --git a/tajo-core/src/main/java/org/apache/tajo/net/CachedDNSResolver.java b/tajo-core/src/main/java/org/apache/tajo/net/CachedDNSResolver.java deleted file mode 100644 index 2a53c47..0000000 --- a/tajo-core/src/main/java/org/apache/tajo/net/CachedDNSResolver.java +++ /dev/null @@ -1,64 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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 - * - * 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. - */ - -package org.apache.tajo.net; - -import java.net.InetAddress; -import java.net.UnknownHostException; -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; - -public class CachedDNSResolver { - private static Map<String, String> hostNameToIPAddrMap - = new ConcurrentHashMap<String, String>(); - - private static CachedDNSResolver instance; - - static { - instance = new CachedDNSResolver(); - } - - public static String resolve(String hostName) { - - if (hostNameToIPAddrMap.containsKey(hostName)) { - return hostNameToIPAddrMap.get(hostName); - } - - String ipAddress = null; - try { - ipAddress = InetAddress.getByName(hostName).getHostAddress(); - } catch (UnknownHostException e) { - e.printStackTrace(); - } - hostNameToIPAddrMap.put(hostName, ipAddress); - - return ipAddress; - } - - public static String [] resolve(String [] hostNames) { - if (hostNames == null) { - return null; - } - - String [] resolved = new String[hostNames.length]; - for (int i = 0; i < hostNames.length; i++) { - resolved[i] = resolve(hostNames[i]); - } - return resolved; - } -}
