FAQ
Repository: hive
Updated Branches:
   refs/heads/branch-1 db2efe42a -> 178708231


http://git-wip-us.apache.org/repos/asf/hive/blob/c8295051/ql/src/test/org/apache/hadoop/hive/ql/txn/compactor/CompactorTest.java
----------------------------------------------------------------------
diff --git a/ql/src/test/org/apache/hadoop/hive/ql/txn/compactor/CompactorTest.java b/ql/src/test/org/apache/hadoop/hive/ql/txn/compactor/CompactorTest.java
index 5545574..cac4623 100644
--- a/ql/src/test/org/apache/hadoop/hive/ql/txn/compactor/CompactorTest.java
+++ b/ql/src/test/org/apache/hadoop/hive/ql/txn/compactor/CompactorTest.java
@@ -20,15 +20,31 @@ package org.apache.hadoop.hive.ql.txn.compactor;
  import org.apache.commons.logging.Log;
  import org.apache.commons.logging.LogFactory;
  import org.apache.hadoop.conf.Configuration;
-import org.apache.hadoop.fs.*;
+import org.apache.hadoop.fs.FSDataInputStream;
+import org.apache.hadoop.fs.FSDataOutputStream;
+import org.apache.hadoop.fs.FileStatus;
+import org.apache.hadoop.fs.FileSystem;
+import org.apache.hadoop.fs.Path;
  import org.apache.hadoop.hive.common.ValidTxnList;
  import org.apache.hadoop.hive.conf.HiveConf;
  import org.apache.hadoop.hive.metastore.HiveMetaStoreClient;
  import org.apache.hadoop.hive.metastore.IMetaStoreClient;
-import org.apache.hadoop.hive.metastore.MetaStoreThread;
-import org.apache.hadoop.hive.metastore.api.*;
-import org.apache.hadoop.hive.metastore.txn.CompactionTxnHandler;
+import org.apache.hadoop.hive.metastore.api.AbortTxnRequest;
+import org.apache.hadoop.hive.metastore.api.CommitTxnRequest;
+import org.apache.hadoop.hive.metastore.api.FieldSchema;
+import org.apache.hadoop.hive.metastore.api.MetaException;
+import org.apache.hadoop.hive.metastore.api.NoSuchTxnException;
+import org.apache.hadoop.hive.metastore.api.OpenTxnRequest;
+import org.apache.hadoop.hive.metastore.api.OpenTxnsResponse;
+import org.apache.hadoop.hive.metastore.api.Order;
+import org.apache.hadoop.hive.metastore.api.Partition;
+import org.apache.hadoop.hive.metastore.api.SerDeInfo;
+import org.apache.hadoop.hive.metastore.api.StorageDescriptor;
+import org.apache.hadoop.hive.metastore.api.Table;
+import org.apache.hadoop.hive.metastore.api.TxnAbortedException;
  import org.apache.hadoop.hive.metastore.txn.TxnDbUtil;
+import org.apache.hadoop.hive.metastore.txn.TxnStore;
+import org.apache.hadoop.hive.metastore.txn.TxnUtils;
  import org.apache.hadoop.hive.ql.io.AcidInputFormat;
  import org.apache.hadoop.hive.ql.io.AcidOutputFormat;
  import org.apache.hadoop.hive.ql.io.AcidUtils;
@@ -39,7 +55,11 @@ import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector;
  import org.apache.hadoop.io.Text;
  import org.apache.hadoop.io.Writable;
  import org.apache.hadoop.io.WritableComparable;
-import org.apache.hadoop.mapred.*;
+import org.apache.hadoop.mapred.InputSplit;
+import org.apache.hadoop.mapred.JobConf;
+import org.apache.hadoop.mapred.RecordReader;
+import org.apache.hadoop.mapred.RecordWriter;
+import org.apache.hadoop.mapred.Reporter;
  import org.apache.hadoop.util.Progressable;
  import org.apache.thrift.TException;

@@ -62,7 +82,7 @@ public abstract class CompactorTest {
    static final private String CLASS_NAME = CompactorTest.class.getName();
    static final private Log LOG = LogFactory.getLog(CLASS_NAME);

- protected CompactionTxnHandler txnHandler;
+ protected TxnStore txnHandler;
    protected IMetaStoreClient ms;
    protected long sleepTime = 1000;
    protected HiveConf conf;
@@ -75,7 +95,7 @@ public abstract class CompactorTest {
      TxnDbUtil.setConfValues(conf);
      TxnDbUtil.cleanDb();
      ms = new HiveMetaStoreClient(conf);
- txnHandler = new CompactionTxnHandler(conf);
+ txnHandler = TxnUtils.getTxnStore(conf);
      tmpdir = new File(System.getProperty("java.io.tmpdir") +
          System.getProperty("file.separator") + "compactor_test_tables");
      tmpdir.mkdir();

http://git-wip-us.apache.org/repos/asf/hive/blob/c8295051/ql/src/test/org/apache/hadoop/hive/ql/txn/compactor/TestCleaner.java
----------------------------------------------------------------------
diff --git a/ql/src/test/org/apache/hadoop/hive/ql/txn/compactor/TestCleaner.java b/ql/src/test/org/apache/hadoop/hive/ql/txn/compactor/TestCleaner.java
index 913c8bc..17634f0 100644
--- a/ql/src/test/org/apache/hadoop/hive/ql/txn/compactor/TestCleaner.java
+++ b/ql/src/test/org/apache/hadoop/hive/ql/txn/compactor/TestCleaner.java
@@ -17,7 +17,6 @@
   */
  package org.apache.hadoop.hive.ql.txn.compactor;

-import org.apache.hadoop.hive.metastore.txn.TxnHandler;
  import org.junit.Assert;
  import org.apache.commons.logging.Log;
  import org.apache.commons.logging.LogFactory;
@@ -25,6 +24,7 @@ import org.apache.hadoop.fs.Path;
  import org.apache.hadoop.hive.conf.HiveConf;
  import org.apache.hadoop.hive.metastore.api.*;
  import org.apache.hadoop.hive.metastore.txn.CompactionInfo;
+import org.apache.hadoop.hive.metastore.txn.TxnStore;
  import org.junit.Test;

  import java.util.ArrayList;
@@ -73,7 +73,7 @@ public class TestCleaner extends CompactorTest {
      // Check there are no compactions requests left.
      ShowCompactResponse rsp = txnHandler.showCompact(new ShowCompactRequest());
      Assert.assertEquals(1, rsp.getCompactsSize());
- Assert.assertTrue(TxnHandler.SUCCEEDED_RESPONSE.equals(rsp.getCompacts().get(0).getState()));
+ Assert.assertTrue(TxnStore.SUCCEEDED_RESPONSE.equals(rsp.getCompacts().get(0).getState()));

      // Check that the files are removed
      List<Path> paths = getDirectories(conf, t, null);
@@ -105,7 +105,7 @@ public class TestCleaner extends CompactorTest {
      // Check there are no compactions requests left.
      ShowCompactResponse rsp = txnHandler.showCompact(new ShowCompactRequest());
      Assert.assertEquals(1, rsp.getCompactsSize());
- Assert.assertTrue(TxnHandler.SUCCEEDED_RESPONSE.equals(rsp.getCompacts().get(0).getState()));
+ Assert.assertTrue(TxnStore.SUCCEEDED_RESPONSE.equals(rsp.getCompacts().get(0).getState()));

      // Check that the files are removed
      List<Path> paths = getDirectories(conf, t, p);
@@ -135,7 +135,7 @@ public class TestCleaner extends CompactorTest {
      // Check there are no compactions requests left.
      ShowCompactResponse rsp = txnHandler.showCompact(new ShowCompactRequest());
      Assert.assertEquals(1, rsp.getCompactsSize());
- Assert.assertTrue(TxnHandler.SUCCEEDED_RESPONSE.equals(rsp.getCompacts().get(0).getState()));
+ Assert.assertTrue(TxnStore.SUCCEEDED_RESPONSE.equals(rsp.getCompacts().get(0).getState()));

      // Check that the files are removed
      List<Path> paths = getDirectories(conf, t, null);
@@ -174,7 +174,7 @@ public class TestCleaner extends CompactorTest {
      // Check there are no compactions requests left.
      ShowCompactResponse rsp = txnHandler.showCompact(new ShowCompactRequest());
      Assert.assertEquals(1, rsp.getCompactsSize());
- Assert.assertTrue(TxnHandler.SUCCEEDED_RESPONSE.equals(rsp.getCompacts().get(0).getState()));
+ Assert.assertTrue(TxnStore.SUCCEEDED_RESPONSE.equals(rsp.getCompacts().get(0).getState()));

      // Check that the files are removed
      List<Path> paths = getDirectories(conf, t, p);
@@ -329,7 +329,7 @@ public class TestCleaner extends CompactorTest {
      rsp = txnHandler.showCompact(new ShowCompactRequest());
      compacts = rsp.getCompacts();
      Assert.assertEquals(1, compacts.size());
- Assert.assertTrue(TxnHandler.SUCCEEDED_RESPONSE.equals(rsp.getCompacts().get(0).getState()));
+ Assert.assertTrue(TxnStore.SUCCEEDED_RESPONSE.equals(rsp.getCompacts().get(0).getState()));
    }

    @Test
@@ -403,7 +403,7 @@ public class TestCleaner extends CompactorTest {
      rsp = txnHandler.showCompact(new ShowCompactRequest());
      compacts = rsp.getCompacts();
      Assert.assertEquals(1, compacts.size());
- Assert.assertTrue(TxnHandler.SUCCEEDED_RESPONSE.equals(rsp.getCompacts().get(0).getState()));
+ Assert.assertTrue(TxnStore.SUCCEEDED_RESPONSE.equals(rsp.getCompacts().get(0).getState()));
    }

    @Test
@@ -429,7 +429,7 @@ public class TestCleaner extends CompactorTest {
      // Check there are no compactions requests left.
      ShowCompactResponse rsp = txnHandler.showCompact(new ShowCompactRequest());
      Assert.assertEquals(1, rsp.getCompactsSize());
- Assert.assertTrue(TxnHandler.SUCCEEDED_RESPONSE.equals(rsp.getCompacts().get(0).getState()));
+ Assert.assertTrue(TxnStore.SUCCEEDED_RESPONSE.equals(rsp.getCompacts().get(0).getState()));

      // Check that the files are removed
      List<Path> paths = getDirectories(conf, t, p);
@@ -460,7 +460,7 @@ public class TestCleaner extends CompactorTest {
      // Check there are no compactions requests left.
      ShowCompactResponse rsp = txnHandler.showCompact(new ShowCompactRequest());
      Assert.assertEquals(1, rsp.getCompactsSize());
- Assert.assertTrue(TxnHandler.SUCCEEDED_RESPONSE.equals(rsp.getCompacts().get(0).getState()));
+ Assert.assertTrue(TxnStore.SUCCEEDED_RESPONSE.equals(rsp.getCompacts().get(0).getState()));
    }

    @Test
@@ -488,7 +488,7 @@ public class TestCleaner extends CompactorTest {
      // Check there are no compactions requests left.
      ShowCompactResponse rsp = txnHandler.showCompact(new ShowCompactRequest());
      Assert.assertEquals(1, rsp.getCompactsSize());
- Assert.assertTrue(TxnHandler.SUCCEEDED_RESPONSE.equals(rsp.getCompacts().get(0).getState()));
+ Assert.assertTrue(TxnStore.SUCCEEDED_RESPONSE.equals(rsp.getCompacts().get(0).getState()));
    }
    @Override
    boolean useHive130DeltaDirName() {

http://git-wip-us.apache.org/repos/asf/hive/blob/c8295051/ql/src/test/org/apache/hadoop/hive/ql/txn/compactor/TestInitiator.java
----------------------------------------------------------------------
diff --git a/ql/src/test/org/apache/hadoop/hive/ql/txn/compactor/TestInitiator.java b/ql/src/test/org/apache/hadoop/hive/ql/txn/compactor/TestInitiator.java
index 07f477d..f84bd7e 100644
--- a/ql/src/test/org/apache/hadoop/hive/ql/txn/compactor/TestInitiator.java
+++ b/ql/src/test/org/apache/hadoop/hive/ql/txn/compactor/TestInitiator.java
@@ -17,13 +17,12 @@
   */
  package org.apache.hadoop.hive.ql.txn.compactor;

-import org.apache.hadoop.hive.metastore.txn.TxnHandler;
  import org.junit.Assert;
  import org.apache.commons.logging.Log;
  import org.apache.commons.logging.LogFactory;
  import org.apache.hadoop.hive.conf.HiveConf;
  import org.apache.hadoop.hive.metastore.api.*;
-import org.apache.hadoop.hive.metastore.txn.TxnDbUtil;
+import org.apache.hadoop.hive.metastore.txn.TxnStore;
  import org.junit.Before;
  import org.junit.Test;

@@ -205,12 +204,12 @@ public class TestInitiator extends CompactorTest {
      LockResponse res = txnHandler.lock(req);
      txnHandler.abortTxn(new AbortTxnRequest(txnid));

- for (int i = 0; i < TxnHandler.TIMED_OUT_TXN_ABORT_BATCH_SIZE + 50; i++) {
+ for (int i = 0; i < TxnStore.TIMED_OUT_TXN_ABORT_BATCH_SIZE + 50; i++) {
        txnid = openTxn();
        txnHandler.abortTxn(new AbortTxnRequest(txnid));
      }
      GetOpenTxnsResponse openTxns = txnHandler.getOpenTxns();
- Assert.assertEquals(TxnHandler.TIMED_OUT_TXN_ABORT_BATCH_SIZE + 50 + 1, openTxns.getOpen_txnsSize());
+ Assert.assertEquals(TxnStore.TIMED_OUT_TXN_ABORT_BATCH_SIZE + 50 + 1, openTxns.getOpen_txnsSize());

      startInitiator();


http://git-wip-us.apache.org/repos/asf/hive/blob/c8295051/ql/src/test/org/apache/hadoop/hive/ql/txn/compactor/TestWorker.java
----------------------------------------------------------------------
diff --git a/ql/src/test/org/apache/hadoop/hive/ql/txn/compactor/TestWorker.java b/ql/src/test/org/apache/hadoop/hive/ql/txn/compactor/TestWorker.java
index 8862402..381eeb3 100644
--- a/ql/src/test/org/apache/hadoop/hive/ql/txn/compactor/TestWorker.java
+++ b/ql/src/test/org/apache/hadoop/hive/ql/txn/compactor/TestWorker.java
@@ -22,13 +22,18 @@ import org.apache.commons.logging.LogFactory;
  import org.apache.hadoop.fs.*;
  import org.apache.hadoop.hive.conf.HiveConf;
  import org.apache.hadoop.hive.metastore.api.*;
-import org.apache.hadoop.hive.metastore.txn.TxnHandler;
+import org.apache.hadoop.hive.metastore.txn.TxnStore;
  import org.apache.hadoop.hive.ql.io.AcidUtils;
  import org.junit.Assert;
  import org.junit.Before;
  import org.junit.Test;

-import java.io.*;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.DataInput;
+import java.io.DataInputStream;
+import java.io.DataOutput;
+import java.io.DataOutputStream;
  import java.util.ArrayList;
  import java.util.Arrays;
  import java.util.BitSet;
@@ -935,7 +940,7 @@ public class TestWorker extends CompactorTest {
      ShowCompactResponse rsp = txnHandler.showCompact(new ShowCompactRequest());
      List<ShowCompactResponseElement> compacts = rsp.getCompacts();
      Assert.assertEquals(1, compacts.size());
- Assert.assertTrue(TxnHandler.SUCCEEDED_RESPONSE.equals(compacts.get(0).getState()));
+ Assert.assertTrue(TxnStore.SUCCEEDED_RESPONSE.equals(compacts.get(0).getState()));
    }

    @Test
@@ -960,6 +965,6 @@ public class TestWorker extends CompactorTest {
      ShowCompactResponse rsp = txnHandler.showCompact(new ShowCompactRequest());
      List<ShowCompactResponseElement> compacts = rsp.getCompacts();
      Assert.assertEquals(1, compacts.size());
- Assert.assertTrue(TxnHandler.SUCCEEDED_RESPONSE.equals(rsp.getCompacts().get(0).getState()));
+ Assert.assertTrue(TxnStore.SUCCEEDED_RESPONSE.equals(rsp.getCompacts().get(0).getState()));
    }
  }

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 3 of 4 | next ›
Discussion Overview
groupcommits @
categorieshive, hadoop
postedMar 23, '16 at 6:59p
activeMar 24, '16 at 11:28p
posts4
users1
websitehive.apache.org

1 user in discussion

Ekoifman: 4 posts

People

Translate

site design / logo © 2021 Grokbase