You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by na...@apache.org on 2010/12/28 20:22:41 UTC

svn commit: r1053411 - in /hive/trunk: CHANGES.txt metastore/src/test/org/apache/hadoop/hive/metastore/TestRemoteHiveMetaStore.java

Author: namit
Date: Tue Dec 28 19:22:41 2010
New Revision: 1053411

URL: http://svn.apache.org/viewvc?rev=1053411&view=rev
Log:
HIVE-1870 Add TestRemoteHiveMetaStore deleted accidently
(Carl Steinbach via namit)


Added:
    hive/trunk/metastore/src/test/org/apache/hadoop/hive/metastore/TestRemoteHiveMetaStore.java
Modified:
    hive/trunk/CHANGES.txt

Modified: hive/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hive/trunk/CHANGES.txt?rev=1053411&r1=1053410&r2=1053411&view=diff
==============================================================================
--- hive/trunk/CHANGES.txt (original)
+++ hive/trunk/CHANGES.txt Tue Dec 28 19:22:41 2010
@@ -650,6 +650,9 @@ Trunk -  Unreleased
     HIVE-1864 Fix test load_overwrite..q
     (Carl Steinbach via namit)
 
+    HIVE-1870 Add TestRemoveHiveMetaStore deleted accidently
+    (Carl Steinbach via namit)
+
   TESTS
 
     HIVE-1464. improve  test query performance

Added: hive/trunk/metastore/src/test/org/apache/hadoop/hive/metastore/TestRemoteHiveMetaStore.java
URL: http://svn.apache.org/viewvc/hive/trunk/metastore/src/test/org/apache/hadoop/hive/metastore/TestRemoteHiveMetaStore.java?rev=1053411&view=auto
==============================================================================
--- hive/trunk/metastore/src/test/org/apache/hadoop/hive/metastore/TestRemoteHiveMetaStore.java (added)
+++ hive/trunk/metastore/src/test/org/apache/hadoop/hive/metastore/TestRemoteHiveMetaStore.java Tue Dec 28 19:22:41 2010
@@ -0,0 +1,65 @@
+/**
+ * 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.hadoop.hive.metastore;
+
+import org.apache.hadoop.hive.conf.HiveConf;
+
+
+public class TestRemoteHiveMetaStore extends TestHiveMetaStore {
+  private static final String METASTORE_PORT = "29083";
+  private static boolean isServerRunning = false;
+
+  private static class RunMS implements Runnable {
+
+      @Override
+      public void run() {
+        System.out.println("Running metastore!");
+        String [] args = new String [1];
+        args[0] = METASTORE_PORT;
+        HiveMetaStore.main(args);
+      }
+
+    }
+
+  @Override
+  protected void setUp() throws Exception {
+    super.setUp();
+    if(isServerRunning) {
+      return;
+    }
+    Thread t = new Thread(new RunMS());
+    t.start();
+
+    // Wait a little bit for the metastore to start. Should probably have
+    // a better way of detecting if the metastore has started?
+    Thread.sleep(5000);
+
+    // hive.metastore.local should be defined in HiveConf
+    hiveConf.set("hive.metastore.local", "false");
+    hiveConf.setVar(HiveConf.ConfVars.METASTOREURIS, "thrift://localhost:" + METASTORE_PORT);
+    hiveConf.setIntVar(HiveConf.ConfVars.METATORETHRIFTRETRIES, 3);
+
+    client = new HiveMetaStoreClient(hiveConf);
+    isThriftClient = true;
+
+    // Now you have the client - run necessary tests.
+    isServerRunning = true;
+  }
+
+}