You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by ct...@apache.org on 2014/04/08 02:46:19 UTC
[1/2] git commit: ACCUMULO-2648 Make AccumuloInputFormat use correct
RangeInputSplit
Repository: accumulo
Updated Branches:
refs/heads/1.5.2-SNAPSHOT 7ffa80a18 -> 5363d781d
ACCUMULO-2648 Make AccumuloInputFormat use correct RangeInputSplit
Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/e33c1f49
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/e33c1f49
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/e33c1f49
Branch: refs/heads/1.5.2-SNAPSHOT
Commit: e33c1f4951faac982acc48f18a0e1256c1d11ea5
Parents: 7ffa80a
Author: Christopher Tubbs <ct...@apache.org>
Authored: Mon Apr 7 20:06:31 2014 -0400
Committer: Christopher Tubbs <ct...@apache.org>
Committed: Mon Apr 7 20:06:31 2014 -0400
----------------------------------------------------------------------
.../apache/accumulo/core/client/mapred/InputFormatBase.java | 1 +
.../accumulo/core/client/mapreduce/AccumuloInputFormat.java | 6 +++---
.../apache/accumulo/core/client/mapreduce/InputFormatBase.java | 5 +++--
.../core/client/mapreduce/EmptySplitsAccumuloInputFormat.java | 6 +++---
4 files changed, 10 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/accumulo/blob/e33c1f49/core/src/main/java/org/apache/accumulo/core/client/mapred/InputFormatBase.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/mapred/InputFormatBase.java b/core/src/main/java/org/apache/accumulo/core/client/mapred/InputFormatBase.java
index 0438b78..16efa89 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/mapred/InputFormatBase.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/mapred/InputFormatBase.java
@@ -909,6 +909,7 @@ public abstract class InputFormatBase<K,V> implements InputFormat<K,V> {
}
/**
+ * @deprecated since 1.5.2; Use {@link org.apache.accumulo.core.client.mapred.RangeInputSplit} instead.
* @see org.apache.accumulo.core.client.mapred.RangeInputSplit
*/
@Deprecated
http://git-wip-us.apache.org/repos/asf/accumulo/blob/e33c1f49/core/src/main/java/org/apache/accumulo/core/client/mapreduce/AccumuloInputFormat.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/mapreduce/AccumuloInputFormat.java b/core/src/main/java/org/apache/accumulo/core/client/mapreduce/AccumuloInputFormat.java
index 0220339..c08b50b 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/mapreduce/AccumuloInputFormat.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/mapreduce/AccumuloInputFormat.java
@@ -50,10 +50,10 @@ public class AccumuloInputFormat extends InputFormatBase<Key,Value> {
@Override
public RecordReader<Key,Value> createRecordReader(InputSplit split, TaskAttemptContext context) throws IOException, InterruptedException {
log.setLevel(getLogLevel(context));
-
+
// Override the log level from the configuration as if the RangeInputSplit has one it's the more correct one to use.
- if (split instanceof RangeInputSplit) {
- RangeInputSplit risplit = (RangeInputSplit) split;
+ if (split instanceof org.apache.accumulo.core.client.mapreduce.RangeInputSplit) {
+ org.apache.accumulo.core.client.mapreduce.RangeInputSplit risplit = (org.apache.accumulo.core.client.mapreduce.RangeInputSplit) split;
Level level = risplit.getLogLevel();
if (null != level) {
log.setLevel(level);
http://git-wip-us.apache.org/repos/asf/accumulo/blob/e33c1f49/core/src/main/java/org/apache/accumulo/core/client/mapreduce/InputFormatBase.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/mapreduce/InputFormatBase.java b/core/src/main/java/org/apache/accumulo/core/client/mapreduce/InputFormatBase.java
index 5066620..0e9444d 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/mapreduce/InputFormatBase.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/mapreduce/InputFormatBase.java
@@ -1198,8 +1198,8 @@ public abstract class InputFormatBase<K,V> extends InputFormat<K,V> {
for (Entry<String,String> opt : setting.getOptions().entrySet()) {
String deprecatedOption;
try {
- deprecatedOption = setting.getName() + AccumuloIteratorOption.FIELD_SEP + URLEncoder.encode(opt.getKey(), "UTF-8")
- + AccumuloIteratorOption.FIELD_SEP + URLEncoder.encode(opt.getValue(), "UTF-8");
+ deprecatedOption = setting.getName() + AccumuloIteratorOption.FIELD_SEP + URLEncoder.encode(opt.getKey(), "UTF-8") + AccumuloIteratorOption.FIELD_SEP
+ + URLEncoder.encode(opt.getValue(), "UTF-8");
} catch (UnsupportedEncodingException e) {
throw new RuntimeException(e);
}
@@ -1320,6 +1320,7 @@ public abstract class InputFormatBase<K,V> extends InputFormat<K,V> {
}
/**
+ * @deprecated since 1.5.2; Use {@link org.apache.accumulo.core.client.mapreduce.RangeInputSplit} instead.
* @see org.apache.accumulo.core.client.mapreduce.RangeInputSplit
*/
@Deprecated
http://git-wip-us.apache.org/repos/asf/accumulo/blob/e33c1f49/core/src/test/java/org/apache/accumulo/core/client/mapreduce/EmptySplitsAccumuloInputFormat.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/accumulo/core/client/mapreduce/EmptySplitsAccumuloInputFormat.java b/core/src/test/java/org/apache/accumulo/core/client/mapreduce/EmptySplitsAccumuloInputFormat.java
index 440dbf7..68ac78f 100644
--- a/core/src/test/java/org/apache/accumulo/core/client/mapreduce/EmptySplitsAccumuloInputFormat.java
+++ b/core/src/test/java/org/apache/accumulo/core/client/mapreduce/EmptySplitsAccumuloInputFormat.java
@@ -27,11 +27,11 @@ import org.apache.hadoop.mapreduce.JobContext;
* AccumuloInputFormat which returns an "empty" RangeInputSplit
*/
public class EmptySplitsAccumuloInputFormat extends AccumuloInputFormat {
-
+
@Override
public List<InputSplit> getSplits(JobContext context) throws IOException {
super.getSplits(context);
-
- return Arrays.<InputSplit> asList(new RangeInputSplit());
+
+ return Arrays.<InputSplit> asList(new org.apache.accumulo.core.client.mapreduce.RangeInputSplit());
}
}
[2/2] git commit: ACCUMULO-2551 Fix type safety and import warnings.
Posted by ct...@apache.org.
ACCUMULO-2551 Fix type safety and import warnings.
Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/5363d781
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/5363d781
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/5363d781
Branch: refs/heads/1.5.2-SNAPSHOT
Commit: 5363d781d3c7f304765c1bdef93969e84f1d934f
Parents: e33c1f4
Author: Christopher Tubbs <ct...@apache.org>
Authored: Mon Apr 7 20:07:28 2014 -0400
Committer: Christopher Tubbs <ct...@apache.org>
Committed: Mon Apr 7 20:07:28 2014 -0400
----------------------------------------------------------------------
.../org/apache/accumulo/fate/ReadOnlyStore.java | 22 ++++++------
.../java/org/apache/accumulo/fate/TStore.java | 16 ++++-----
.../org/apache/accumulo/server/fate/Admin.java | 38 +++++++++-----------
.../test/continuous/ContinuousVerify.java | 1 -
4 files changed, 35 insertions(+), 42 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5363d781/fate/src/main/java/org/apache/accumulo/fate/ReadOnlyStore.java
----------------------------------------------------------------------
diff --git a/fate/src/main/java/org/apache/accumulo/fate/ReadOnlyStore.java b/fate/src/main/java/org/apache/accumulo/fate/ReadOnlyStore.java
index 7cb20ff..ad5e7e1 100644
--- a/fate/src/main/java/org/apache/accumulo/fate/ReadOnlyStore.java
+++ b/fate/src/main/java/org/apache/accumulo/fate/ReadOnlyStore.java
@@ -16,26 +16,25 @@
*/
package org.apache.accumulo.fate;
-import org.apache.accumulo.fate.ReadOnlyTStore.TStatus;
-import com.google.common.base.Preconditions;
-
import java.io.Serializable;
import java.util.EnumSet;
import java.util.List;
+import com.google.common.base.Preconditions;
+
/**
* This store decorates a TStore to make sure it can not be modified.
- *
- * Unlike relying directly on the ReadOnlyTStore interface, this class will not allow subsequent users to cast back to a
- * mutable TStore successfully.
- *
+ *
+ * Unlike relying directly on the ReadOnlyTStore interface, this class will not allow subsequent users to cast back to a mutable TStore successfully.
+ *
*/
public class ReadOnlyStore<T> implements ReadOnlyTStore<T> {
private final TStore<T> store;
/**
- * @param store may not be null
+ * @param store
+ * may not be null
*/
public ReadOnlyStore(TStore<T> store) {
Preconditions.checkNotNull(store);
@@ -59,14 +58,15 @@ public class ReadOnlyStore<T> implements ReadOnlyTStore<T> {
/**
* Decorates a Repo to make sure it is treated as a ReadOnlyRepo.
- *
+ *
* Similar to ReadOnlyStore, won't allow subsequent user to cast a ReadOnlyRepo back to a mutable Repo.
*/
protected static class ReadOnlyRepoWrapper<X> implements ReadOnlyRepo<X> {
private final Repo<X> repo;
/**
- * @param repo may not be null
+ * @param repo
+ * may not be null
*/
public ReadOnlyRepoWrapper(Repo<X> repo) {
Preconditions.checkNotNull(repo);
@@ -86,7 +86,7 @@ public class ReadOnlyStore<T> implements ReadOnlyTStore<T> {
@Override
public ReadOnlyRepo<T> top(long tid) {
- return new ReadOnlyRepoWrapper(store.top(tid));
+ return new ReadOnlyRepoWrapper<T>(store.top(tid));
}
@Override
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5363d781/fate/src/main/java/org/apache/accumulo/fate/TStore.java
----------------------------------------------------------------------
diff --git a/fate/src/main/java/org/apache/accumulo/fate/TStore.java b/fate/src/main/java/org/apache/accumulo/fate/TStore.java
index 5ca24fc..882cdbd 100644
--- a/fate/src/main/java/org/apache/accumulo/fate/TStore.java
+++ b/fate/src/main/java/org/apache/accumulo/fate/TStore.java
@@ -17,8 +17,6 @@
package org.apache.accumulo.fate;
import java.io.Serializable;
-import java.util.EnumSet;
-import java.util.List;
/**
* Transaction Store: a place to save transactions
@@ -28,14 +26,14 @@ import java.util.List;
* fails, the stack can be unwound, undoing each operation.
*/
public interface TStore<T> extends ReadOnlyTStore<T> {
-
+
/**
* Create a new transaction id
*
* @return a transaction id
*/
long create();
-
+
/**
* Get the current operation for the given transaction id.
*
@@ -45,7 +43,7 @@ public interface TStore<T> extends ReadOnlyTStore<T> {
*/
@Override
Repo<T> top(long tid);
-
+
/**
* Update the given transaction with the next operation
*
@@ -55,14 +53,14 @@ public interface TStore<T> extends ReadOnlyTStore<T> {
* the operation
*/
void push(long tid, Repo<T> repo) throws StackOverflowException;
-
+
/**
* Remove the last pushed operation from the given transaction.
*
* @param tid
*/
void pop(long tid);
-
+
/**
* Update the state of a given transaction
*
@@ -72,9 +70,9 @@ public interface TStore<T> extends ReadOnlyTStore<T> {
* execution status
*/
void setStatus(long tid, TStatus status);
-
+
void setProperty(long tid, String prop, Serializable val);
-
+
/**
* Remove the transaction from the store.
*
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5363d781/server/src/main/java/org/apache/accumulo/server/fate/Admin.java
----------------------------------------------------------------------
diff --git a/server/src/main/java/org/apache/accumulo/server/fate/Admin.java b/server/src/main/java/org/apache/accumulo/server/fate/Admin.java
index fc9e342..16bfd0c 100644
--- a/server/src/main/java/org/apache/accumulo/server/fate/Admin.java
+++ b/server/src/main/java/org/apache/accumulo/server/fate/Admin.java
@@ -24,8 +24,8 @@ import org.apache.accumulo.core.cli.Help;
import org.apache.accumulo.core.client.Instance;
import org.apache.accumulo.core.zookeeper.ZooUtil;
import org.apache.accumulo.fate.AdminUtil;
-import org.apache.accumulo.fate.ZooStore;
import org.apache.accumulo.fate.ReadOnlyStore;
+import org.apache.accumulo.fate.ZooStore;
import org.apache.accumulo.fate.zookeeper.IZooReaderWriter;
import org.apache.accumulo.server.client.HdfsZooInstance;
import org.apache.accumulo.server.master.Master;
@@ -35,29 +35,25 @@ import com.beust.jcommander.JCommander;
import com.beust.jcommander.Parameter;
import com.beust.jcommander.Parameters;
-
/**
* A utility to administer FATE operations
*/
public class Admin {
-
+
static class TxOpts {
- @Parameter(description="<txid>", required=true)
+ @Parameter(description = "<txid>", required = true)
List<String> args = new ArrayList<String>();
}
-
- @Parameters(commandDescription="Stop an existing FATE by transaction id")
- static class FailOpts extends TxOpts {
- }
-
- @Parameters(commandDescription="Delete an existing FATE by transaction id")
- static class DeleteOpts extends TxOpts {
- }
-
- @Parameters(commandDescription="List the existing FATE transactions")
- static class PrintOpts {
- }
-
+
+ @Parameters(commandDescription = "Stop an existing FATE by transaction id")
+ static class FailOpts extends TxOpts {}
+
+ @Parameters(commandDescription = "Delete an existing FATE by transaction id")
+ static class DeleteOpts extends TxOpts {}
+
+ @Parameters(commandDescription = "List the existing FATE transactions")
+ static class PrintOpts {}
+
public static void main(String[] args) throws Exception {
Help opts = new Help();
JCommander jc = new JCommander(opts);
@@ -70,15 +66,15 @@ public class Admin {
jc.usage();
System.exit(-1);
}
-
+
AdminUtil<Master> admin = new AdminUtil<Master>();
-
+
Instance instance = HdfsZooInstance.getInstance();
String path = ZooUtil.getRoot(instance) + Constants.ZFATE;
String masterPath = ZooUtil.getRoot(instance) + Constants.ZMASTER_LOCK;
IZooReaderWriter zk = ZooReaderWriter.getRetryingInstance();
ZooStore<Master> zs = new ZooStore<Master>(path, zk);
-
+
if (jc.getParsedCommand().equals("fail")) {
if (!admin.prepFail(zs, zk, masterPath, args[1])) {
System.exit(1);
@@ -89,7 +85,7 @@ public class Admin {
}
admin.deleteLocks(zs, zk, ZooUtil.getRoot(instance) + Constants.ZTABLE_LOCKS, args[1]);
} else if (jc.getParsedCommand().equals("print")) {
- admin.print(new ReadOnlyStore(zs), zk, ZooUtil.getRoot(instance) + Constants.ZTABLE_LOCKS);
+ admin.print(new ReadOnlyStore<Master>(zs), zk, ZooUtil.getRoot(instance) + Constants.ZTABLE_LOCKS);
}
}
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5363d781/test/src/main/java/org/apache/accumulo/test/continuous/ContinuousVerify.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/continuous/ContinuousVerify.java b/test/src/main/java/org/apache/accumulo/test/continuous/ContinuousVerify.java
index 8095b50..06b9a7c 100644
--- a/test/src/main/java/org/apache/accumulo/test/continuous/ContinuousVerify.java
+++ b/test/src/main/java/org/apache/accumulo/test/continuous/ContinuousVerify.java
@@ -38,7 +38,6 @@ import org.apache.hadoop.fs.Path;
import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.io.VLongWritable;
-import org.apache.hadoop.mapred.Counters.Counter;
import org.apache.hadoop.mapreduce.Job;
import org.apache.hadoop.mapreduce.Mapper;
import org.apache.hadoop.mapreduce.Reducer;