-
Notifications
You must be signed in to change notification settings - Fork 4.8k
HIVE-17561 #253
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HIVE-17561 #253
Changes from all commits
5a77937
ca8d319
8e9cd35
2997941
f53e3f6
bfe95d0
7acb277
80b150a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -55,7 +55,7 @@ | |
| import org.apache.hadoop.hive.ql.processors.CommandProcessorResponse; | ||
| import org.apache.hadoop.hive.ql.session.SessionState; | ||
| import org.apache.hadoop.hive.ql.txn.AcidCompactionHistoryService; | ||
| import org.apache.hadoop.hive.ql.txn.AcidOpenTxnsCounterService; | ||
| import org.apache.hadoop.hive.metastore.txn.AcidOpenTxnsCounterService; | ||
| import org.apache.hadoop.hive.ql.txn.compactor.Cleaner; | ||
| import org.apache.hadoop.hive.ql.txn.compactor.Initiator; | ||
| import org.apache.hadoop.hive.ql.txn.compactor.Worker; | ||
|
|
@@ -70,6 +70,10 @@ | |
| import org.slf4j.Logger; | ||
| import org.slf4j.LoggerFactory; | ||
|
|
||
| /** | ||
| * TODO: this should be merged with TestTxnCommands once that is checked in | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Probably not. These are long running test suites - combining them will make it worse and PTest is unable to parallelize anything within one suite
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agreed. |
||
| * specifically the tests; the supporting code here is just a clone of TestTxnCommands | ||
| */ | ||
| public class TestTxnCommands2 { | ||
| static final private Logger LOG = LoggerFactory.getLogger(TestTxnCommands2.class); | ||
| protected static final String TEST_DATA_DIR = new File(System.getProperty("java.io.tmpdir") + | ||
|
|
@@ -118,7 +122,6 @@ public void setUp() throws Exception { | |
| } | ||
|
|
||
| protected void setUpWithTableProperties(String tableProperties) throws Exception { | ||
| tearDown(); | ||
| hiveConf = new HiveConf(this.getClass()); | ||
| hiveConf.set(HiveConf.ConfVars.PREEXECHOOKS.varname, ""); | ||
| hiveConf.set(HiveConf.ConfVars.POSTEXECHOOKS.varname, ""); | ||
|
|
@@ -131,7 +134,7 @@ protected void setUpWithTableProperties(String tableProperties) throws Exception | |
| hiveConf.setBoolVar(HiveConf.ConfVars.MERGE_CARDINALITY_VIOLATION_CHECK, true); | ||
|
|
||
| TxnDbUtil.setConfValues(hiveConf); | ||
| TxnDbUtil.prepDb(); | ||
| TxnDbUtil.prepDb(hiveConf); | ||
| File f = new File(TEST_WAREHOUSE_DIR); | ||
| if (f.exists()) { | ||
| FileUtil.fullyDelete(f); | ||
|
|
@@ -168,7 +171,7 @@ public void tearDown() throws Exception { | |
| d.close(); | ||
| d = null; | ||
| } | ||
| TxnDbUtil.cleanDb(); | ||
| TxnDbUtil.cleanDb(hiveConf); | ||
| } finally { | ||
| FileUtils.deleteDirectory(new File(TEST_DATA_DIR)); | ||
| } | ||
|
|
@@ -1284,7 +1287,8 @@ public void testOpenTxnsCounter() throws Exception { | |
| OpenTxnsResponse openTxnsResponse = txnHandler.openTxns(new OpenTxnRequest(3, "me", "localhost")); | ||
|
|
||
| AcidOpenTxnsCounterService openTxnsCounterService = new AcidOpenTxnsCounterService(); | ||
| runHouseKeeperService(openTxnsCounterService, hiveConf); // will update current number of open txns to 3 | ||
| openTxnsCounterService.setConf(hiveConf); | ||
| openTxnsCounterService.run(); // will update current number of open txns to 3 | ||
|
|
||
| MetaException exception = null; | ||
| // This should fail once it finds out the threshold has been reached | ||
|
|
@@ -1301,7 +1305,7 @@ public void testOpenTxnsCounter() throws Exception { | |
| for (long txnid : openTxnsResponse.getTxn_ids()) { | ||
| txnHandler.commitTxn(new CommitTxnRequest(txnid)); | ||
| } | ||
| runHouseKeeperService(openTxnsCounterService, hiveConf); // will update current number of open txns back to 0 | ||
| openTxnsCounterService.run(); // will update current number of open txns back to 0 | ||
| exception = null; | ||
| try { | ||
| txnHandler.openTxns(new OpenTxnRequest(1, "him", "localhost")); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this better and if it is, why only this service is converted to use the pool?
One concern is that with a pool that has > 1 thread, if some task is taking a long time (for whatever reason) you may end up the pool launching another concurrent one. I don't think any Acid*Service are designed with that in mind.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just haven't gotten to the others yet.
It's better because it gives you one pool to manage the size of. It is also a simpler design with each thread not being long running.
scheduleAtFixedRate will not result in multiple running instances of a given task. See the javadocs.