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 2013/07/25 00:30:39 UTC
git commit: ACCUMULO-1000 Fix generated thrift and suppress unchecked
cast warning (because a comprehensive generics fix would touch far too much
code)
Updated Branches:
refs/heads/master 9dc244484 -> 6677a162c
ACCUMULO-1000 Fix generated thrift and suppress unchecked cast warning
(because a comprehensive generics fix would touch far too much code)
Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/6677a162
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/6677a162
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/6677a162
Branch: refs/heads/master
Commit: 6677a162c0d17a5e69675a5e82e6a1841933984b
Parents: 9dc2444
Author: Christopher Tubbs <ct...@apache.org>
Authored: Wed Jul 24 18:29:03 2013 -0400
Committer: Christopher Tubbs <ct...@apache.org>
Committed: Wed Jul 24 18:29:03 2013 -0400
----------------------------------------------------------------------
.../core/data/thrift/TConditionalMutation.java | 36 +++---
.../core/data/thrift/TConditionalSession.java | 20 +++-
.../thrift/TabletClientService.java | 116 +++++++++++--------
.../server/tabletserver/TabletServer.java | 77 ++++++------
4 files changed, 141 insertions(+), 108 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/accumulo/blob/6677a162/core/src/main/java/org/apache/accumulo/core/data/thrift/TConditionalMutation.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/data/thrift/TConditionalMutation.java b/core/src/main/java/org/apache/accumulo/core/data/thrift/TConditionalMutation.java
index 1928803..3f9b3f7 100644
--- a/core/src/main/java/org/apache/accumulo/core/data/thrift/TConditionalMutation.java
+++ b/core/src/main/java/org/apache/accumulo/core/data/thrift/TConditionalMutation.java
@@ -512,14 +512,14 @@ import org.slf4j.LoggerFactory;
case 1: // CONDITIONS
if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
{
- org.apache.thrift.protocol.TList _list106 = iprot.readListBegin();
- struct.conditions = new ArrayList<TCondition>(_list106.size);
- for (int _i107 = 0; _i107 < _list106.size; ++_i107)
+ org.apache.thrift.protocol.TList _list78 = iprot.readListBegin();
+ struct.conditions = new ArrayList<TCondition>(_list78.size);
+ for (int _i79 = 0; _i79 < _list78.size; ++_i79)
{
- TCondition _elem108; // required
- _elem108 = new TCondition();
- _elem108.read(iprot);
- struct.conditions.add(_elem108);
+ TCondition _elem80; // required
+ _elem80 = new TCondition();
+ _elem80.read(iprot);
+ struct.conditions.add(_elem80);
}
iprot.readListEnd();
}
@@ -564,9 +564,9 @@ import org.slf4j.LoggerFactory;
oprot.writeFieldBegin(CONDITIONS_FIELD_DESC);
{
oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.conditions.size()));
- for (TCondition _iter109 : struct.conditions)
+ for (TCondition _iter81 : struct.conditions)
{
- _iter109.write(oprot);
+ _iter81.write(oprot);
}
oprot.writeListEnd();
}
@@ -611,9 +611,9 @@ import org.slf4j.LoggerFactory;
if (struct.isSetConditions()) {
{
oprot.writeI32(struct.conditions.size());
- for (TCondition _iter110 : struct.conditions)
+ for (TCondition _iter82 : struct.conditions)
{
- _iter110.write(oprot);
+ _iter82.write(oprot);
}
}
}
@@ -631,14 +631,14 @@ import org.slf4j.LoggerFactory;
BitSet incoming = iprot.readBitSet(3);
if (incoming.get(0)) {
{
- org.apache.thrift.protocol.TList _list111 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
- struct.conditions = new ArrayList<TCondition>(_list111.size);
- for (int _i112 = 0; _i112 < _list111.size; ++_i112)
+ org.apache.thrift.protocol.TList _list83 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
+ struct.conditions = new ArrayList<TCondition>(_list83.size);
+ for (int _i84 = 0; _i84 < _list83.size; ++_i84)
{
- TCondition _elem113; // required
- _elem113 = new TCondition();
- _elem113.read(iprot);
- struct.conditions.add(_elem113);
+ TCondition _elem85; // required
+ _elem85 = new TCondition();
+ _elem85.read(iprot);
+ struct.conditions.add(_elem85);
}
}
struct.setConditionsIsSet(true);
http://git-wip-us.apache.org/repos/asf/accumulo/blob/6677a162/core/src/main/java/org/apache/accumulo/core/data/thrift/TConditionalSession.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/data/thrift/TConditionalSession.java b/core/src/main/java/org/apache/accumulo/core/data/thrift/TConditionalSession.java
index b3bfa15..e7f8a08 100644
--- a/core/src/main/java/org/apache/accumulo/core/data/thrift/TConditionalSession.java
+++ b/core/src/main/java/org/apache/accumulo/core/data/thrift/TConditionalSession.java
@@ -1,3 +1,19 @@
+/*
+ * 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.
+ */
/**
* Autogenerated by Thrift Compiler (0.9.0)
*
@@ -30,7 +46,7 @@ import java.util.Arrays;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-public class TConditionalSession implements org.apache.thrift.TBase<TConditionalSession, TConditionalSession._Fields>, java.io.Serializable, Cloneable {
+@SuppressWarnings("all") public class TConditionalSession implements org.apache.thrift.TBase<TConditionalSession, TConditionalSession._Fields>, java.io.Serializable, Cloneable {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TConditionalSession");
private static final org.apache.thrift.protocol.TField SESSION_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("sessionId", org.apache.thrift.protocol.TType.I64, (short)1);
@@ -48,7 +64,7 @@ public class TConditionalSession implements org.apache.thrift.TBase<TConditional
public long ttl; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
- public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+ @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
SESSION_ID((short)1, "sessionId"),
TSERVER_LOCK((short)2, "tserverLock"),
TTL((short)3, "ttl");
http://git-wip-us.apache.org/repos/asf/accumulo/blob/6677a162/core/src/main/java/org/apache/accumulo/core/tabletserver/thrift/TabletClientService.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/tabletserver/thrift/TabletClientService.java b/core/src/main/java/org/apache/accumulo/core/tabletserver/thrift/TabletClientService.java
index 19fbb98..bd6578d 100644
--- a/core/src/main/java/org/apache/accumulo/core/tabletserver/thrift/TabletClientService.java
+++ b/core/src/main/java/org/apache/accumulo/core/tabletserver/thrift/TabletClientService.java
@@ -1,3 +1,19 @@
+/*
+ * 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.
+ */
/**
* Autogenerated by Thrift Compiler (0.9.0)
*
@@ -30,7 +46,7 @@ import java.util.Arrays;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-public class TabletClientService {
+@SuppressWarnings("all") public class TabletClientService {
public interface Iface extends org.apache.accumulo.core.client.impl.thrift.ClientService.Iface {
@@ -2850,7 +2866,7 @@ public class TabletClientService {
public boolean isolated; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
- public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+ @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
TINFO((short)11, "tinfo"),
CREDENTIALS((short)1, "credentials"),
EXTENT((short)2, "extent"),
@@ -4472,7 +4488,7 @@ public class TabletClientService {
public TooManyFilesException tmfe; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
- public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+ @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
SUCCESS((short)0, "success"),
SEC((short)1, "sec"),
NSTE((short)2, "nste"),
@@ -5133,7 +5149,7 @@ public class TabletClientService {
public long scanID; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
- public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+ @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
TINFO((short)2, "tinfo"),
SCAN_ID((short)1, "scanID");
@@ -5594,7 +5610,7 @@ public class TabletClientService {
public TooManyFilesException tmfe; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
- public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+ @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
SUCCESS((short)0, "success"),
NSSI((short)1, "nssi"),
NSTE((short)2, "nste"),
@@ -6255,7 +6271,7 @@ public class TabletClientService {
public long scanID; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
- public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+ @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
TINFO((short)2, "tinfo"),
SCAN_ID((short)1, "scanID");
@@ -6724,7 +6740,7 @@ public class TabletClientService {
public boolean waitForWrites; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
- public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+ @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
TINFO((short)8, "tinfo"),
CREDENTIALS((short)1, "credentials"),
BATCH((short)2, "batch"),
@@ -8135,7 +8151,7 @@ public class TabletClientService {
public org.apache.accumulo.core.client.impl.thrift.ThriftSecurityException sec; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
- public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+ @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
SUCCESS((short)0, "success"),
SEC((short)1, "sec");
@@ -8596,7 +8612,7 @@ public class TabletClientService {
public long scanID; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
- public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+ @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
TINFO((short)2, "tinfo"),
SCAN_ID((short)1, "scanID");
@@ -9053,7 +9069,7 @@ public class TabletClientService {
public NoSuchScanIDException nssi; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
- public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+ @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
SUCCESS((short)0, "success"),
NSSI((short)1, "nssi");
@@ -9514,7 +9530,7 @@ public class TabletClientService {
public long scanID; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
- public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+ @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
TINFO((short)2, "tinfo"),
SCAN_ID((short)1, "scanID");
@@ -9969,7 +9985,7 @@ public class TabletClientService {
public NoSuchScanIDException nssi; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
- public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+ @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
NSSI((short)1, "nssi");
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
@@ -10327,7 +10343,7 @@ public class TabletClientService {
public org.apache.accumulo.core.security.thrift.TCredentials credentials; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
- public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+ @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
TINFO((short)2, "tinfo"),
CREDENTIALS((short)1, "credentials");
@@ -10791,7 +10807,7 @@ public class TabletClientService {
public org.apache.accumulo.core.client.impl.thrift.ThriftSecurityException sec; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
- public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+ @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
SUCCESS((short)0, "success"),
SEC((short)1, "sec");
@@ -11251,7 +11267,7 @@ public class TabletClientService {
public List<org.apache.accumulo.core.data.thrift.TMutation> mutations; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
- public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+ @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
TINFO((short)1, "tinfo"),
UPDATE_ID((short)2, "updateID"),
KEY_EXTENT((short)3, "keyExtent"),
@@ -11963,7 +11979,7 @@ public class TabletClientService {
public long updateID; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
- public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+ @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
TINFO((short)2, "tinfo"),
UPDATE_ID((short)1, "updateID");
@@ -12420,7 +12436,7 @@ public class TabletClientService {
public NoSuchScanIDException nssi; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
- public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+ @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
SUCCESS((short)0, "success"),
NSSI((short)1, "nssi");
@@ -12885,7 +12901,7 @@ public class TabletClientService {
public org.apache.accumulo.core.data.thrift.TMutation mutation; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
- public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+ @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
TINFO((short)4, "tinfo"),
CREDENTIALS((short)1, "credentials"),
KEY_EXTENT((short)2, "keyExtent"),
@@ -13557,7 +13573,7 @@ public class TabletClientService {
public ConstraintViolationException cve; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
- public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+ @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
SEC((short)1, "sec"),
NSTE((short)2, "nste"),
CVE((short)3, "cve");
@@ -14119,7 +14135,7 @@ public class TabletClientService {
public String tableID; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
- public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+ @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
TINFO((short)1, "tinfo"),
CREDENTIALS((short)2, "credentials"),
AUTHORIZATIONS((short)3, "authorizations"),
@@ -14833,7 +14849,7 @@ public class TabletClientService {
public org.apache.accumulo.core.client.impl.thrift.ThriftSecurityException sec; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
- public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+ @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
SUCCESS((short)0, "success"),
SEC((short)1, "sec");
@@ -15298,7 +15314,7 @@ public class TabletClientService {
public List<String> symbols; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
- public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+ @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
TINFO((short)1, "tinfo"),
SESS_ID((short)2, "sessID"),
MUTATIONS((short)3, "mutations"),
@@ -16088,7 +16104,7 @@ public class TabletClientService {
public NoSuchScanIDException nssi; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
- public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+ @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
SUCCESS((short)0, "success"),
NSSI((short)1, "nssi");
@@ -16598,7 +16614,7 @@ public class TabletClientService {
public long sessID; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
- public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+ @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
TINFO((short)1, "tinfo"),
SESS_ID((short)2, "sessID");
@@ -17051,7 +17067,7 @@ public class TabletClientService {
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
- public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+ @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
;
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
@@ -17301,7 +17317,7 @@ public class TabletClientService {
public long sessID; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
- public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+ @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
TINFO((short)1, "tinfo"),
SESS_ID((short)2, "sessID");
@@ -17764,7 +17780,7 @@ public class TabletClientService {
public boolean setTime; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
- public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+ @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
TINFO((short)3, "tinfo"),
CREDENTIALS((short)1, "credentials"),
TID((short)4, "tid"),
@@ -18605,7 +18621,7 @@ public class TabletClientService {
public org.apache.accumulo.core.client.impl.thrift.ThriftSecurityException sec; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
- public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+ @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
SUCCESS((short)0, "success"),
SEC((short)1, "sec");
@@ -19119,7 +19135,7 @@ public class TabletClientService {
public ByteBuffer splitPoint; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
- public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+ @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
TINFO((short)4, "tinfo"),
CREDENTIALS((short)1, "credentials"),
EXTENT((short)2, "extent"),
@@ -19795,7 +19811,7 @@ public class TabletClientService {
public NotServingTabletException nste; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
- public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+ @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
SEC((short)1, "sec"),
NSTE((short)2, "nste");
@@ -20257,7 +20273,7 @@ public class TabletClientService {
public org.apache.accumulo.core.data.thrift.TKeyExtent extent; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
- public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+ @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
TINFO((short)5, "tinfo"),
CREDENTIALS((short)1, "credentials"),
LOCK((short)4, "lock"),
@@ -20928,7 +20944,7 @@ public class TabletClientService {
public boolean save; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
- public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+ @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
TINFO((short)5, "tinfo"),
CREDENTIALS((short)1, "credentials"),
LOCK((short)4, "lock"),
@@ -21697,7 +21713,7 @@ public class TabletClientService {
public ByteBuffer endRow; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
- public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+ @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
TINFO((short)4, "tinfo"),
CREDENTIALS((short)1, "credentials"),
LOCK((short)3, "lock"),
@@ -22579,7 +22595,7 @@ public class TabletClientService {
public org.apache.accumulo.core.data.thrift.TKeyExtent extent; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
- public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+ @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
TINFO((short)1, "tinfo"),
CREDENTIALS((short)2, "credentials"),
LOCK((short)3, "lock"),
@@ -23248,7 +23264,7 @@ public class TabletClientService {
public org.apache.accumulo.core.data.thrift.TKeyExtent extent; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
- public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+ @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
TINFO((short)1, "tinfo"),
CREDENTIALS((short)2, "credentials"),
LOCK((short)3, "lock"),
@@ -23921,7 +23937,7 @@ public class TabletClientService {
public ByteBuffer endRow; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
- public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+ @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
TINFO((short)1, "tinfo"),
CREDENTIALS((short)2, "credentials"),
LOCK((short)3, "lock"),
@@ -24799,7 +24815,7 @@ public class TabletClientService {
public org.apache.accumulo.core.security.thrift.TCredentials credentials; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
- public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+ @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
TINFO((short)3, "tinfo"),
CREDENTIALS((short)1, "credentials");
@@ -25263,7 +25279,7 @@ public class TabletClientService {
public org.apache.accumulo.core.client.impl.thrift.ThriftSecurityException sec; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
- public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+ @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
SUCCESS((short)0, "success"),
SEC((short)1, "sec");
@@ -25726,7 +25742,7 @@ public class TabletClientService {
public String tableId; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
- public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+ @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
TINFO((short)3, "tinfo"),
CREDENTIALS((short)1, "credentials"),
TABLE_ID((short)2, "tableId");
@@ -26288,7 +26304,7 @@ public class TabletClientService {
public org.apache.accumulo.core.client.impl.thrift.ThriftSecurityException sec; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
- public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+ @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
SUCCESS((short)0, "success"),
SEC((short)1, "sec");
@@ -26798,7 +26814,7 @@ public class TabletClientService {
public org.apache.accumulo.core.security.thrift.TCredentials credentials; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
- public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+ @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
TINFO((short)2, "tinfo"),
CREDENTIALS((short)1, "credentials");
@@ -27262,7 +27278,7 @@ public class TabletClientService {
public org.apache.accumulo.core.client.impl.thrift.ThriftSecurityException sec; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
- public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+ @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
SUCCESS((short)0, "success"),
SEC((short)1, "sec");
@@ -27725,7 +27741,7 @@ public class TabletClientService {
public String lock; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
- public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+ @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
TINFO((short)3, "tinfo"),
CREDENTIALS((short)1, "credentials"),
LOCK((short)2, "lock");
@@ -28285,7 +28301,7 @@ public class TabletClientService {
public org.apache.accumulo.core.client.impl.thrift.ThriftSecurityException sec; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
- public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+ @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
SEC((short)1, "sec");
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
@@ -28645,7 +28661,7 @@ public class TabletClientService {
public String lock; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
- public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+ @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
TINFO((short)3, "tinfo"),
CREDENTIALS((short)1, "credentials"),
LOCK((short)2, "lock");
@@ -29207,7 +29223,7 @@ public class TabletClientService {
public org.apache.accumulo.core.security.thrift.TCredentials credentials; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
- public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+ @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
TINFO((short)2, "tinfo"),
CREDENTIALS((short)1, "credentials");
@@ -29671,7 +29687,7 @@ public class TabletClientService {
public org.apache.accumulo.core.client.impl.thrift.ThriftSecurityException sec; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
- public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+ @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
SUCCESS((short)0, "success"),
SEC((short)1, "sec");
@@ -30181,7 +30197,7 @@ public class TabletClientService {
public org.apache.accumulo.core.security.thrift.TCredentials credentials; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
- public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+ @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
TINFO((short)2, "tinfo"),
CREDENTIALS((short)1, "credentials");
@@ -30645,7 +30661,7 @@ public class TabletClientService {
public org.apache.accumulo.core.client.impl.thrift.ThriftSecurityException sec; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
- public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+ @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
SUCCESS((short)0, "success"),
SEC((short)1, "sec");
@@ -31157,7 +31173,7 @@ public class TabletClientService {
public List<String> filenames; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
- public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+ @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
TINFO((short)1, "tinfo"),
CREDENTIALS((short)2, "credentials"),
FILENAMES((short)3, "filenames");
http://git-wip-us.apache.org/repos/asf/accumulo/blob/6677a162/server/src/main/java/org/apache/accumulo/server/tabletserver/TabletServer.java
----------------------------------------------------------------------
diff --git a/server/src/main/java/org/apache/accumulo/server/tabletserver/TabletServer.java b/server/src/main/java/org/apache/accumulo/server/tabletserver/TabletServer.java
index ccb95fc..fdbd2f5 100644
--- a/server/src/main/java/org/apache/accumulo/server/tabletserver/TabletServer.java
+++ b/server/src/main/java/org/apache/accumulo/server/tabletserver/TabletServer.java
@@ -382,7 +382,7 @@ public class TabletServer extends AbstractMetricsImpl implements org.apache.accu
long getMaxIdleTime() {
return maxIdle;
}
-
+
/**
* while a session is reserved, it cannot be canceled or removed
*
@@ -404,7 +404,7 @@ public class TabletServer extends AbstractMetricsImpl implements org.apache.accu
synchronized Session reserveSession(long sessionId, boolean wait) {
Session session = sessions.get(sessionId);
if (session != null) {
- while(wait && session.reserved){
+ while (wait && session.reserved) {
try {
wait(1000);
} catch (InterruptedException e) {
@@ -434,7 +434,7 @@ public class TabletServer extends AbstractMetricsImpl implements org.apache.accu
if (session != null)
unreserveSession(session);
}
-
+
synchronized Session getSession(long sessionId) {
Session session = sessions.get(sessionId);
if (session != null)
@@ -450,7 +450,7 @@ public class TabletServer extends AbstractMetricsImpl implements org.apache.accu
Session session = null;
synchronized (this) {
session = sessions.remove(sessionId);
- if(unreserve && session != null)
+ if (unreserve && session != null)
unreserveSession(session);
}
@@ -912,7 +912,7 @@ public class TabletServer extends AbstractMetricsImpl implements org.apache.accu
WriteTracker writeTracker = new WriteTracker();
private RowLocks rowLocks = new RowLocks();
-
+
ThriftClientHandler() {
super(instance, watcher);
log.debug(ThriftClientHandler.class.getName() + " created");
@@ -1742,13 +1742,13 @@ public class TabletServer extends AbstractMetricsImpl implements org.apache.accu
writeTracker.finishWrite(opid);
}
}
-
+
private void checkConditions(Map<KeyExtent,List<ServerConditionalMutation>> updates, ArrayList<TCMResult> results, ConditionalSession cs,
List<String> symbols) throws IOException {
Iterator<Entry<KeyExtent,List<ServerConditionalMutation>>> iter = updates.entrySet().iterator();
CompressedIterators compressedIters = new CompressedIterators(symbols);
-
+
while (iter.hasNext()) {
Entry<KeyExtent,List<ServerConditionalMutation>> entry = iter.next();
Tablet tablet = onlineTablets.get(entry.getKey());
@@ -1759,7 +1759,7 @@ public class TabletServer extends AbstractMetricsImpl implements org.apache.accu
iter.remove();
} else {
List<ServerConditionalMutation> okMutations = new ArrayList<ServerConditionalMutation>(entry.getValue().size());
-
+
for (ServerConditionalMutation scm : entry.getValue()) {
if (checkCondition(results, cs, compressedIters, tablet, scm))
okMutations.add(scm);
@@ -1770,15 +1770,15 @@ public class TabletServer extends AbstractMetricsImpl implements org.apache.accu
}
}
-
- boolean checkCondition(ArrayList<TCMResult> results, ConditionalSession cs, CompressedIterators compressedIters,
- Tablet tablet, ServerConditionalMutation scm) throws IOException {
+
+ boolean checkCondition(ArrayList<TCMResult> results, ConditionalSession cs, CompressedIterators compressedIters, Tablet tablet,
+ ServerConditionalMutation scm) throws IOException {
boolean add = true;
Set<Column> emptyCols = Collections.emptySet();
-
- for(TCondition tc : scm.getConditions()){
+ for (TCondition tc : scm.getConditions()) {
+
Range range;
if (tc.hasTimestamp)
range = Range.exact(new Text(scm.getRow()), new Text(tc.getCf()), new Text(tc.getCq()), new Text(tc.getCv()), tc.getTs());
@@ -1786,7 +1786,7 @@ public class TabletServer extends AbstractMetricsImpl implements org.apache.accu
range = Range.exact(new Text(scm.getRow()), new Text(tc.getCf()), new Text(tc.getCq()), new Text(tc.getCv()));
IterConfig ic = compressedIters.decompress(tc.iterators);
-
+
Scanner scanner = tablet.createScanner(range, 1, emptyCols, cs.auths, ic.ssiList, ic.ssio, false, cs.interruptFlag);
try {
@@ -1821,14 +1821,14 @@ public class TabletServer extends AbstractMetricsImpl implements org.apache.accu
}
return add;
}
-
+
private void writeConditionalMutations(Map<KeyExtent,List<ServerConditionalMutation>> updates, ArrayList<TCMResult> results, ConditionalSession sess) {
Set<Entry<KeyExtent,List<ServerConditionalMutation>>> es = updates.entrySet();
Map<CommitSession,List<Mutation>> sendables = new HashMap<CommitSession,List<Mutation>>();
-
+
boolean sessionCanceled = sess.interruptFlag.get();
-
+
for (Entry<KeyExtent,List<ServerConditionalMutation>> entry : es) {
Tablet tablet = onlineTablets.get(entry.getKey());
if (tablet == null || tablet.isClosed() || sessionCanceled) {
@@ -1837,9 +1837,10 @@ public class TabletServer extends AbstractMetricsImpl implements org.apache.accu
} else {
try {
+ @SuppressWarnings("unchecked")
List<Mutation> mutations = (List<Mutation>) (List<? extends Mutation>) entry.getValue();
if (mutations.size() > 0) {
-
+
CommitSession cs = tablet.prepareMutationsForCommit(new TservConstraintEnv(security, sess.credentials), mutations);
if (cs == null) {
@@ -1884,19 +1885,19 @@ public class TabletServer extends AbstractMetricsImpl implements org.apache.accu
commitSession.commit(mutations);
}
-
+
}
-
+
private Map<KeyExtent,List<ServerConditionalMutation>> conditionalUpdate(ConditionalSession cs, Map<KeyExtent,List<ServerConditionalMutation>> updates,
ArrayList<TCMResult> results, List<String> symbols) throws IOException {
// sort each list of mutations, this is done to avoid deadlock and doing seeks in order is more efficient and detect duplicate rows.
ConditionalMutationSet.sortConditionalMutations(updates);
Map<KeyExtent,List<ServerConditionalMutation>> deferred = new HashMap<KeyExtent,List<ServerConditionalMutation>>();
-
+
// can not process two mutations for the same row, because one will not see what the other writes
ConditionalMutationSet.deferDuplicatesRows(updates, deferred);
-
+
// get as many locks as possible w/o blocking... defer any rows that are locked
List<RowLock> locks = rowLocks.acquireRowlocks(updates, deferred);
try {
@@ -1920,7 +1921,7 @@ public class TabletServer extends AbstractMetricsImpl implements org.apache.accu
for (ByteBuffer auth : authorizations)
if (!userauths.contains(ByteBufferUtil.toBytes(auth)))
throw new ThriftSecurityException(credentials.getPrincipal(), SecurityErrorCode.BAD_AUTHORIZATIONS);
-
+
ConditionalSession cs = new ConditionalSession();
cs.auths = new Authorizations(authorizations);
cs.credentials = credentials;
@@ -1930,7 +1931,7 @@ public class TabletServer extends AbstractMetricsImpl implements org.apache.accu
long sid = sessionManager.createSession(cs, false);
return new TConditionalSession(sid, lockID, sessionManager.getMaxIdleTime());
}
-
+
@Override
public List<TCMResult> conditionalUpdate(TInfo tinfo, long sessID, Map<TKeyExtent,List<TConditionalMutation>> mutations, List<String> symbols)
throws NoSuchScanIDException, TException {
@@ -1943,45 +1944,45 @@ public class TabletServer extends AbstractMetricsImpl implements org.apache.accu
Text tid = new Text(cs.tableId);
long opid = writeTracker.startWrite(TabletType.type(new KeyExtent(tid, null, null)));
- try{
+ try {
Map<KeyExtent,List<ServerConditionalMutation>> updates = Translator.translate(mutations, Translator.TKET,
new Translator.ListTranslator<TConditionalMutation,ServerConditionalMutation>(ServerConditionalMutation.TCMT));
-
- for(KeyExtent ke : updates.keySet())
- if(!ke.getTableId().equals(tid))
- throw new IllegalArgumentException("Unexpected table id "+tid+" != "+ke.getTableId());
+
+ for (KeyExtent ke : updates.keySet())
+ if (!ke.getTableId().equals(tid))
+ throw new IllegalArgumentException("Unexpected table id " + tid + " != " + ke.getTableId());
ArrayList<TCMResult> results = new ArrayList<TCMResult>();
Map<KeyExtent,List<ServerConditionalMutation>> deferred = conditionalUpdate(cs, updates, results, symbols);
-
+
while (deferred.size() > 0) {
deferred = conditionalUpdate(cs, deferred, results, symbols);
}
-
+
return results;
} catch (IOException ioe) {
throw new TException(ioe);
- }finally{
+ } finally {
writeTracker.finishWrite(opid);
sessionManager.unreserveSession(sessID);
}
}
-
+
@Override
public void invalidateConditionalUpdate(TInfo tinfo, long sessID) throws TException {
- //this method should wait for any running conditional update to complete
- //after this method returns a conditional update should not be able to start
+ // this method should wait for any running conditional update to complete
+ // after this method returns a conditional update should not be able to start
ConditionalSession cs = (ConditionalSession) sessionManager.getSession(sessID);
if (cs != null)
cs.interruptFlag.set(true);
cs = (ConditionalSession) sessionManager.reserveSession(sessID, true);
- if(cs != null)
+ if (cs != null)
sessionManager.removeSession(sessID, true);
}
-
+
@Override
public void closeConditionalUpdate(TInfo tinfo, long sessID) throws TException {
sessionManager.removeSession(sessID, false);
@@ -3037,7 +3038,7 @@ public class TabletServer extends AbstractMetricsImpl implements org.apache.accu
}
clientAddress = new InetSocketAddress(clientAddress.getHostName(), clientPort);
announceExistence();
-
+
ThreadPoolExecutor distWorkQThreadPool = new SimpleThreadPool(getSystemConfiguration().getCount(Property.TSERV_WORKQ_THREADS), "distributed work queue");
bulkFailedCopyQ = new DistributedWorkQueue(ZooUtil.getRoot(instance) + Constants.ZBULK_FAILED_COPYQ);