Return-Path: X-Original-To: apmail-incubator-accumulo-commits-archive@minotaur.apache.org Delivered-To: apmail-incubator-accumulo-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 1230698CD for ; Thu, 27 Oct 2011 15:27:22 +0000 (UTC) Received: (qmail 65280 invoked by uid 500); 27 Oct 2011 15:27:22 -0000 Delivered-To: apmail-incubator-accumulo-commits-archive@incubator.apache.org Received: (qmail 65257 invoked by uid 500); 27 Oct 2011 15:27:22 -0000 Mailing-List: contact accumulo-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: accumulo-dev@incubator.apache.org Delivered-To: mailing list accumulo-commits@incubator.apache.org Received: (qmail 65206 invoked by uid 99); 27 Oct 2011 15:27:21 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 27 Oct 2011 15:27:21 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 27 Oct 2011 15:27:01 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id D410C2388B45; Thu, 27 Oct 2011 15:26:14 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1189806 [8/46] - in /incubator/accumulo: branches/1.3/contrib/ branches/1.3/src/core/src/main/java/org/apache/accumulo/core/client/ branches/1.3/src/core/src/main/java/org/apache/accumulo/core/client/admin/ branches/1.3/src/core/src/main/j... Date: Thu, 27 Oct 2011 15:25:17 -0000 To: accumulo-commits@incubator.apache.org From: vines@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20111027152614.D410C2388B45@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Modified: incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/data/thrift/TMutation.java URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/data/thrift/TMutation.java?rev=1189806&r1=1189805&r2=1189806&view=diff ============================================================================== --- incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/data/thrift/TMutation.java (original) +++ incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/data/thrift/TMutation.java Thu Oct 27 15:24:51 2011 @@ -5,46 +5,41 @@ */ package org.apache.accumulo.core.data.thrift; - - import org.apache.thrift.*; import org.apache.thrift.meta_data.*; import org.apache.thrift.protocol.*; @SuppressWarnings("serial") -public class TMutation implements TBase, java.io.Serializable, Cloneable { +public class TMutation implements TBase, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("TMutation"); - - private static final TField ROW_FIELD_DESC = new TField("row", TType.STRING, (short)1); - private static final TField DATA_FIELD_DESC = new TField("data", TType.STRING, (short)2); - private static final TField VALUES_FIELD_DESC = new TField("values", TType.LIST, (short)3); - private static final TField ENTRIES_FIELD_DESC = new TField("entries", TType.I32, (short)4); - + + private static final TField ROW_FIELD_DESC = new TField("row", TType.STRING, (short) 1); + private static final TField DATA_FIELD_DESC = new TField("data", TType.STRING, (short) 2); + private static final TField VALUES_FIELD_DESC = new TField("values", TType.LIST, (short) 3); + private static final TField ENTRIES_FIELD_DESC = new TField("entries", TType.I32, (short) 4); + public byte[] row; public byte[] data; public java.util.List values; public int entries; - + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements TFieldIdEnum { - ROW((short)1, "row"), - DATA((short)2, "data"), - VALUES((short)3, "values"), - ENTRIES((short)4, "entries"); - - private static final java.util.Map byName = new java.util.HashMap(); - + ROW((short) 1, "row"), DATA((short) 2, "data"), VALUES((short) 3, "values"), ENTRIES((short) 4, "entries"); + + private static final java.util.Map byName = new java.util.HashMap(); + static { for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } - + /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { + switch (fieldId) { case 1: // ROW return ROW; case 2: // DATA @@ -57,70 +52,59 @@ public class TMutation implements TBase< return null; } } - + /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. + * Find the _Fields constant that matches fieldId, throwing an exception if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) + throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } - + /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } - + private final short _thriftId; private final String _fieldName; - + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } - + public short getThriftFieldId() { return _thriftId; } - + public String getFieldName() { return _fieldName; } } - + // isset id assignments private static final int __ENTRIES_ISSET_ID = 0; private java.util.BitSet __isset_bit_vector = new java.util.BitSet(1); - - public static final java.util.Map<_Fields, FieldMetaData> metaDataMap; + + public static final java.util.Map<_Fields,FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.ROW, new FieldMetaData("row", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRING))); - tmpMap.put(_Fields.DATA, new FieldMetaData("data", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRING))); - tmpMap.put(_Fields.VALUES, new FieldMetaData("values", TFieldRequirementType.DEFAULT, - new ListMetaData(TType.LIST, - new FieldValueMetaData(TType.STRING)))); - tmpMap.put(_Fields.ENTRIES, new FieldMetaData("entries", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.I32))); + java.util.Map<_Fields,FieldMetaData> tmpMap = new java.util.EnumMap<_Fields,FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.ROW, new FieldMetaData("row", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRING))); + tmpMap.put(_Fields.DATA, new FieldMetaData("data", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRING))); + tmpMap.put(_Fields.VALUES, new FieldMetaData("values", TFieldRequirementType.DEFAULT, new ListMetaData(TType.LIST, new FieldValueMetaData(TType.STRING)))); + tmpMap.put(_Fields.ENTRIES, new FieldMetaData("entries", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.I32))); metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); FieldMetaData.addStructMetaDataMap(TMutation.class, metaDataMap); } - - public TMutation() { - } - - public TMutation( - byte[] row, - byte[] data, - java.util.List values, - int entries) - { + + public TMutation() {} + + public TMutation(byte[] row, byte[] data, java.util.List values, int entries) { this(); this.row = row; this.data = data; @@ -128,7 +112,7 @@ public class TMutation implements TBase< this.entries = entries; setEntriesIsSet(true); } - + /** * Performs a deep copy on other. */ @@ -154,222 +138,222 @@ public class TMutation implements TBase< } this.entries = other.entries; } - + public TMutation deepCopy() { return new TMutation(this); } - + @Deprecated public TMutation clone() { return new TMutation(this); } - + public byte[] getRow() { return this.row; } - + public TMutation setRow(byte[] row) { this.row = row; return this; } - + public void unsetRow() { this.row = null; } - + /** Returns true if field row is set (has been asigned a value) and false otherwise */ public boolean isSetRow() { return this.row != null; } - + public void setRowIsSet(boolean value) { if (!value) { this.row = null; } } - + public byte[] getData() { return this.data; } - + public TMutation setData(byte[] data) { this.data = data; return this; } - + public void unsetData() { this.data = null; } - + /** Returns true if field data is set (has been asigned a value) and false otherwise */ public boolean isSetData() { return this.data != null; } - + public void setDataIsSet(boolean value) { if (!value) { this.data = null; } } - + public int getValuesSize() { return (this.values == null) ? 0 : this.values.size(); } - + public java.util.Iterator getValuesIterator() { return (this.values == null) ? null : this.values.iterator(); } - + public void addToValues(byte[] elem) { if (this.values == null) { this.values = new java.util.ArrayList(); } this.values.add(elem); } - + public java.util.List getValues() { return this.values; } - + public TMutation setValues(java.util.List values) { this.values = values; return this; } - + public void unsetValues() { this.values = null; } - + /** Returns true if field values is set (has been asigned a value) and false otherwise */ public boolean isSetValues() { return this.values != null; } - + public void setValuesIsSet(boolean value) { if (!value) { this.values = null; } } - + public int getEntries() { return this.entries; } - + public TMutation setEntries(int entries) { this.entries = entries; setEntriesIsSet(true); return this; } - + public void unsetEntries() { __isset_bit_vector.clear(__ENTRIES_ISSET_ID); } - + /** Returns true if field entries is set (has been asigned a value) and false otherwise */ public boolean isSetEntries() { return __isset_bit_vector.get(__ENTRIES_ISSET_ID); } - + public void setEntriesIsSet(boolean value) { __isset_bit_vector.set(__ENTRIES_ISSET_ID, value); } - + @SuppressWarnings("unchecked") public void setFieldValue(_Fields field, Object value) { switch (field) { - case ROW: - if (value == null) { - unsetRow(); - } else { - setRow((byte[])value); - } - break; - - case DATA: - if (value == null) { - unsetData(); - } else { - setData((byte[])value); - } - break; - - case VALUES: - if (value == null) { - unsetValues(); - } else { - setValues((java.util.List)value); - } - break; - - case ENTRIES: - if (value == null) { - unsetEntries(); - } else { - setEntries((Integer)value); - } - break; - + case ROW: + if (value == null) { + unsetRow(); + } else { + setRow((byte[]) value); + } + break; + + case DATA: + if (value == null) { + unsetData(); + } else { + setData((byte[]) value); + } + break; + + case VALUES: + if (value == null) { + unsetValues(); + } else { + setValues((java.util.List) value); + } + break; + + case ENTRIES: + if (value == null) { + unsetEntries(); + } else { + setEntries((Integer) value); + } + break; + } } - + public void setFieldValue(int fieldID, Object value) { setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value); } - + public Object getFieldValue(_Fields field) { switch (field) { - case ROW: - return getRow(); - - case DATA: - return getData(); - - case VALUES: - return getValues(); - - case ENTRIES: - return new Integer(getEntries()); - + case ROW: + return getRow(); + + case DATA: + return getData(); + + case VALUES: + return getValues(); + + case ENTRIES: + return new Integer(getEntries()); + } throw new IllegalStateException(); } - + public Object getFieldValue(int fieldId) { return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId)); } - + /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */ public boolean isSet(_Fields field) { switch (field) { - case ROW: - return isSetRow(); - case DATA: - return isSetData(); - case VALUES: - return isSetValues(); - case ENTRIES: - return isSetEntries(); + case ROW: + return isSetRow(); + case DATA: + return isSetData(); + case VALUES: + return isSetValues(); + case ENTRIES: + return isSetEntries(); } throw new IllegalStateException(); } - + public boolean isSet(int fieldID) { return isSet(_Fields.findByThriftIdOrThrow(fieldID)); } - + @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof TMutation) - return this.equals((TMutation)that); + return this.equals((TMutation) that); return false; } - + public boolean equals(TMutation that) { if (that == null) return false; - + boolean this_present_row = true && this.isSetRow(); boolean that_present_row = true && that.isSetRow(); if (this_present_row || that_present_row) { @@ -378,7 +362,7 @@ public class TMutation implements TBase< if (!java.util.Arrays.equals(this.row, that.row)) return false; } - + boolean this_present_data = true && this.isSetData(); boolean that_present_data = true && that.isSetData(); if (this_present_data || that_present_data) { @@ -387,7 +371,7 @@ public class TMutation implements TBase< if (!java.util.Arrays.equals(this.data, that.data)) return false; } - + boolean this_present_values = true && this.isSetValues(); boolean that_present_values = true && that.isSetValues(); if (this_present_values || that_present_values) { @@ -396,7 +380,7 @@ public class TMutation implements TBase< if (!this.values.equals(that.values)) return false; } - + boolean this_present_entries = true; boolean that_present_entries = true; if (this_present_entries || that_present_entries) { @@ -405,28 +389,29 @@ public class TMutation implements TBase< if (this.entries != that.entries) return false; } - + return true; } - + @Override public int hashCode() { return 0; } - + public int compareTo(TMutation other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } - + int lastComparison = 0; - TMutation typedOther = (TMutation)other; - + TMutation typedOther = (TMutation) other; + lastComparison = Boolean.valueOf(isSetRow()).compareTo(typedOther.isSetRow()); if (lastComparison != 0) { return lastComparison; } - if (isSetRow()) { lastComparison = TBaseHelper.compareTo(this.row, typedOther.row); + if (isSetRow()) { + lastComparison = TBaseHelper.compareTo(this.row, typedOther.row); if (lastComparison != 0) { return lastComparison; } @@ -435,7 +420,8 @@ public class TMutation implements TBase< if (lastComparison != 0) { return lastComparison; } - if (isSetData()) { lastComparison = TBaseHelper.compareTo(this.data, typedOther.data); + if (isSetData()) { + lastComparison = TBaseHelper.compareTo(this.data, typedOther.data); if (lastComparison != 0) { return lastComparison; } @@ -444,7 +430,8 @@ public class TMutation implements TBase< if (lastComparison != 0) { return lastComparison; } - if (isSetValues()) { lastComparison = TBaseHelper.compareTo(this.values, typedOther.values); + if (isSetValues()) { + lastComparison = TBaseHelper.compareTo(this.values, typedOther.values); if (lastComparison != 0) { return lastComparison; } @@ -453,35 +440,35 @@ public class TMutation implements TBase< if (lastComparison != 0) { return lastComparison; } - if (isSetEntries()) { lastComparison = TBaseHelper.compareTo(this.entries, typedOther.entries); + if (isSetEntries()) { + lastComparison = TBaseHelper.compareTo(this.entries, typedOther.entries); if (lastComparison != 0) { return lastComparison; } } return 0; } - + public void read(TProtocol iprot) throws TException { TField field; iprot.readStructBegin(); - while (true) - { + while (true) { field = iprot.readFieldBegin(); - if (field.type == TType.STOP) { + if (field.type == TType.STOP) { break; } switch (field.id) { case 1: // ROW if (field.type == TType.STRING) { this.row = iprot.readBinary(); - } else { + } else { TProtocolUtil.skip(iprot, field.type); } break; case 2: // DATA if (field.type == TType.STRING) { this.data = iprot.readBinary(); - } else { + } else { TProtocolUtil.skip(iprot, field.type); } break; @@ -490,15 +477,14 @@ public class TMutation implements TBase< { TList _list0 = iprot.readListBegin(); this.values = new java.util.ArrayList(_list0.size); - for (int _i1 = 0; _i1 < _list0.size; ++_i1) - { + for (int _i1 = 0; _i1 < _list0.size; ++_i1) { byte[] _elem2; _elem2 = iprot.readBinary(); this.values.add(_elem2); } iprot.readListEnd(); } - } else { + } else { TProtocolUtil.skip(iprot, field.type); } break; @@ -506,7 +492,7 @@ public class TMutation implements TBase< if (field.type == TType.I32) { this.entries = iprot.readI32(); setEntriesIsSet(true); - } else { + } else { TProtocolUtil.skip(iprot, field.type); } break; @@ -516,14 +502,14 @@ public class TMutation implements TBase< iprot.readFieldEnd(); } iprot.readStructEnd(); - + // check for required fields of primitive type, which can't be checked in the validate method validate(); } - + public void write(TProtocol oprot) throws TException { validate(); - + oprot.writeStructBegin(STRUCT_DESC); if (this.row != null) { oprot.writeFieldBegin(ROW_FIELD_DESC); @@ -539,8 +525,7 @@ public class TMutation implements TBase< oprot.writeFieldBegin(VALUES_FIELD_DESC); { oprot.writeListBegin(new TList(TType.STRING, this.values.size())); - for (byte[] _iter3 : this.values) - { + for (byte[] _iter3 : this.values) { oprot.writeBinary(_iter3); } oprot.writeListEnd(); @@ -553,7 +538,7 @@ public class TMutation implements TBase< oprot.writeFieldStop(); oprot.writeStructEnd(); } - + @Override public String toString() { StringBuilder sb = new StringBuilder("TMutation("); @@ -561,24 +546,30 @@ public class TMutation implements TBase< if (this.row == null) { sb.append("null"); } else { - int __row_size = Math.min(this.row.length, 128); - for (int i = 0; i < __row_size; i++) { - if (i != 0) sb.append(" "); - sb.append(Integer.toHexString(this.row[i]).length() > 1 ? Integer.toHexString(this.row[i]).substring(Integer.toHexString(this.row[i]).length() - 2).toUpperCase() : "0" + Integer.toHexString(this.row[i]).toUpperCase()); - } - if (this.row.length > 128) sb.append(" ..."); + int __row_size = Math.min(this.row.length, 128); + for (int i = 0; i < __row_size; i++) { + if (i != 0) + sb.append(" "); + sb.append(Integer.toHexString(this.row[i]).length() > 1 ? Integer.toHexString(this.row[i]).substring(Integer.toHexString(this.row[i]).length() - 2) + .toUpperCase() : "0" + Integer.toHexString(this.row[i]).toUpperCase()); + } + if (this.row.length > 128) + sb.append(" ..."); } sb.append(", "); sb.append("data:"); if (this.data == null) { sb.append("null"); } else { - int __data_size = Math.min(this.data.length, 128); - for (int i = 0; i < __data_size; i++) { - if (i != 0) sb.append(" "); - sb.append(Integer.toHexString(this.data[i]).length() > 1 ? Integer.toHexString(this.data[i]).substring(Integer.toHexString(this.data[i]).length() - 2).toUpperCase() : "0" + Integer.toHexString(this.data[i]).toUpperCase()); - } - if (this.data.length > 128) sb.append(" ..."); + int __data_size = Math.min(this.data.length, 128); + for (int i = 0; i < __data_size; i++) { + if (i != 0) + sb.append(" "); + sb.append(Integer.toHexString(this.data[i]).length() > 1 ? Integer.toHexString(this.data[i]).substring(Integer.toHexString(this.data[i]).length() - 2) + .toUpperCase() : "0" + Integer.toHexString(this.data[i]).toUpperCase()); + } + if (this.data.length > 128) + sb.append(" ..."); } sb.append(", "); sb.append("values:"); @@ -593,10 +584,9 @@ public class TMutation implements TBase< sb.append(")"); return sb.toString(); } - + public void validate() throws TException { // check for required fields } - + } - Modified: incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/data/thrift/TRange.java URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/data/thrift/TRange.java?rev=1189806&r1=1189805&r2=1189806&view=diff ============================================================================== --- incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/data/thrift/TRange.java (original) +++ incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/data/thrift/TRange.java Thu Oct 27 15:24:51 2011 @@ -5,52 +5,50 @@ */ package org.apache.accumulo.core.data.thrift; - - import org.apache.thrift.*; import org.apache.thrift.meta_data.*; import org.apache.thrift.protocol.*; @SuppressWarnings("serial") -public class TRange implements TBase, java.io.Serializable, Cloneable { +public class TRange implements TBase, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("TRange"); - - private static final TField START_FIELD_DESC = new TField("start", TType.STRUCT, (short)1); - private static final TField STOP_FIELD_DESC = new TField("stop", TType.STRUCT, (short)2); - private static final TField START_KEY_INCLUSIVE_FIELD_DESC = new TField("startKeyInclusive", TType.BOOL, (short)3); - private static final TField STOP_KEY_INCLUSIVE_FIELD_DESC = new TField("stopKeyInclusive", TType.BOOL, (short)4); - private static final TField INFINITE_START_KEY_FIELD_DESC = new TField("infiniteStartKey", TType.BOOL, (short)5); - private static final TField INFINITE_STOP_KEY_FIELD_DESC = new TField("infiniteStopKey", TType.BOOL, (short)6); - + + private static final TField START_FIELD_DESC = new TField("start", TType.STRUCT, (short) 1); + private static final TField STOP_FIELD_DESC = new TField("stop", TType.STRUCT, (short) 2); + private static final TField START_KEY_INCLUSIVE_FIELD_DESC = new TField("startKeyInclusive", TType.BOOL, (short) 3); + private static final TField STOP_KEY_INCLUSIVE_FIELD_DESC = new TField("stopKeyInclusive", TType.BOOL, (short) 4); + private static final TField INFINITE_START_KEY_FIELD_DESC = new TField("infiniteStartKey", TType.BOOL, (short) 5); + private static final TField INFINITE_STOP_KEY_FIELD_DESC = new TField("infiniteStopKey", TType.BOOL, (short) 6); + public TKey start; public TKey stop; public boolean startKeyInclusive; public boolean stopKeyInclusive; public boolean infiniteStartKey; public boolean infiniteStopKey; - + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements TFieldIdEnum { - START((short)1, "start"), - STOP((short)2, "stop"), - START_KEY_INCLUSIVE((short)3, "startKeyInclusive"), - STOP_KEY_INCLUSIVE((short)4, "stopKeyInclusive"), - INFINITE_START_KEY((short)5, "infiniteStartKey"), - INFINITE_STOP_KEY((short)6, "infiniteStopKey"); - - private static final java.util.Map byName = new java.util.HashMap(); - + START((short) 1, "start"), + STOP((short) 2, "stop"), + START_KEY_INCLUSIVE((short) 3, "startKeyInclusive"), + STOP_KEY_INCLUSIVE((short) 4, "stopKeyInclusive"), + INFINITE_START_KEY((short) 5, "infiniteStartKey"), + INFINITE_STOP_KEY((short) 6, "infiniteStopKey"); + + private static final java.util.Map byName = new java.util.HashMap(); + static { for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } - + /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { + switch (fieldId) { case 1: // START return START; case 2: // STOP @@ -67,78 +65,64 @@ public class TRange implements TBase metaDataMap; + + public static final java.util.Map<_Fields,FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.START, new FieldMetaData("start", TFieldRequirementType.DEFAULT, - new StructMetaData(TType.STRUCT, TKey.class))); - tmpMap.put(_Fields.STOP, new FieldMetaData("stop", TFieldRequirementType.DEFAULT, - new StructMetaData(TType.STRUCT, TKey.class))); - tmpMap.put(_Fields.START_KEY_INCLUSIVE, new FieldMetaData("startKeyInclusive", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.BOOL))); - tmpMap.put(_Fields.STOP_KEY_INCLUSIVE, new FieldMetaData("stopKeyInclusive", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.BOOL))); - tmpMap.put(_Fields.INFINITE_START_KEY, new FieldMetaData("infiniteStartKey", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.BOOL))); - tmpMap.put(_Fields.INFINITE_STOP_KEY, new FieldMetaData("infiniteStopKey", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.BOOL))); + java.util.Map<_Fields,FieldMetaData> tmpMap = new java.util.EnumMap<_Fields,FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.START, new FieldMetaData("start", TFieldRequirementType.DEFAULT, new StructMetaData(TType.STRUCT, TKey.class))); + tmpMap.put(_Fields.STOP, new FieldMetaData("stop", TFieldRequirementType.DEFAULT, new StructMetaData(TType.STRUCT, TKey.class))); + tmpMap.put(_Fields.START_KEY_INCLUSIVE, new FieldMetaData("startKeyInclusive", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.BOOL))); + tmpMap.put(_Fields.STOP_KEY_INCLUSIVE, new FieldMetaData("stopKeyInclusive", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.BOOL))); + tmpMap.put(_Fields.INFINITE_START_KEY, new FieldMetaData("infiniteStartKey", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.BOOL))); + tmpMap.put(_Fields.INFINITE_STOP_KEY, new FieldMetaData("infiniteStopKey", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.BOOL))); metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); FieldMetaData.addStructMetaDataMap(TRange.class, metaDataMap); } - - public TRange() { - } - - public TRange( - TKey start, - TKey stop, - boolean startKeyInclusive, - boolean stopKeyInclusive, - boolean infiniteStartKey, - boolean infiniteStopKey) - { + + public TRange() {} + + public TRange(TKey start, TKey stop, boolean startKeyInclusive, boolean stopKeyInclusive, boolean infiniteStartKey, boolean infiniteStopKey) { this(); this.start = start; this.stop = stop; @@ -151,7 +135,7 @@ public class TRange implements TBaseother. */ @@ -169,277 +153,277 @@ public class TRange implements TBase, java.io.Serializable, Cloneable { +public class UpdateErrors implements TBase, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("UpdateErrors"); - - private static final TField FAILED_EXTENTS_FIELD_DESC = new TField("failedExtents", TType.MAP, (short)1); - private static final TField VIOLATION_SUMMARIES_FIELD_DESC = new TField("violationSummaries", TType.LIST, (short)2); - private static final TField AUTHORIZATION_FAILURES_FIELD_DESC = new TField("authorizationFailures", TType.LIST, (short)3); - + + private static final TField FAILED_EXTENTS_FIELD_DESC = new TField("failedExtents", TType.MAP, (short) 1); + private static final TField VIOLATION_SUMMARIES_FIELD_DESC = new TField("violationSummaries", TType.LIST, (short) 2); + private static final TField AUTHORIZATION_FAILURES_FIELD_DESC = new TField("authorizationFailures", TType.LIST, (short) 3); + public java.util.Map failedExtents; public java.util.List violationSummaries; public java.util.List authorizationFailures; - + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements TFieldIdEnum { - FAILED_EXTENTS((short)1, "failedExtents"), - VIOLATION_SUMMARIES((short)2, "violationSummaries"), - AUTHORIZATION_FAILURES((short)3, "authorizationFailures"); - - private static final java.util.Map byName = new java.util.HashMap(); - + FAILED_EXTENTS((short) 1, "failedExtents"), + VIOLATION_SUMMARIES((short) 2, "violationSummaries"), + AUTHORIZATION_FAILURES((short) 3, "authorizationFailures"); + + private static final java.util.Map byName = new java.util.HashMap(); + static { for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } - + /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { + switch (fieldId) { case 1: // FAILED_EXTENTS return FAILED_EXTENTS; case 2: // VIOLATION_SUMMARIES @@ -52,89 +50,81 @@ public class UpdateErrors implements TBa return null; } } - + /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. + * Find the _Fields constant that matches fieldId, throwing an exception if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) + throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } - + /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } - + private final short _thriftId; private final String _fieldName; - + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } - + public short getThriftFieldId() { return _thriftId; } - + public String getFieldName() { return _fieldName; } } - + // isset id assignments - - public static final java.util.Map<_Fields, FieldMetaData> metaDataMap; + + public static final java.util.Map<_Fields,FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.FAILED_EXTENTS, new FieldMetaData("failedExtents", TFieldRequirementType.DEFAULT, - new MapMetaData(TType.MAP, - new StructMetaData(TType.STRUCT, TKeyExtent.class), - new FieldValueMetaData(TType.I64)))); - tmpMap.put(_Fields.VIOLATION_SUMMARIES, new FieldMetaData("violationSummaries", TFieldRequirementType.DEFAULT, - new ListMetaData(TType.LIST, - new StructMetaData(TType.STRUCT, TConstraintViolationSummary.class)))); - tmpMap.put(_Fields.AUTHORIZATION_FAILURES, new FieldMetaData("authorizationFailures", TFieldRequirementType.DEFAULT, - new ListMetaData(TType.LIST, - new StructMetaData(TType.STRUCT, TKeyExtent.class)))); + java.util.Map<_Fields,FieldMetaData> tmpMap = new java.util.EnumMap<_Fields,FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.FAILED_EXTENTS, new FieldMetaData("failedExtents", TFieldRequirementType.DEFAULT, new MapMetaData(TType.MAP, new StructMetaData( + TType.STRUCT, TKeyExtent.class), new FieldValueMetaData(TType.I64)))); + tmpMap.put(_Fields.VIOLATION_SUMMARIES, new FieldMetaData("violationSummaries", TFieldRequirementType.DEFAULT, new ListMetaData(TType.LIST, + new StructMetaData(TType.STRUCT, TConstraintViolationSummary.class)))); + tmpMap.put(_Fields.AUTHORIZATION_FAILURES, new FieldMetaData("authorizationFailures", TFieldRequirementType.DEFAULT, new ListMetaData(TType.LIST, + new StructMetaData(TType.STRUCT, TKeyExtent.class)))); metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); FieldMetaData.addStructMetaDataMap(UpdateErrors.class, metaDataMap); } - - public UpdateErrors() { - } - - public UpdateErrors( - java.util.Map failedExtents, - java.util.List violationSummaries, - java.util.List authorizationFailures) - { + + public UpdateErrors() {} + + public UpdateErrors(java.util.Map failedExtents, java.util.List violationSummaries, + java.util.List authorizationFailures) { this(); this.failedExtents = failedExtents; this.violationSummaries = violationSummaries; this.authorizationFailures = authorizationFailures; } - + /** * Performs a deep copy on other. */ public UpdateErrors(UpdateErrors other) { if (other.isSetFailedExtents()) { java.util.Map __this__failedExtents = new java.util.HashMap(); - for (java.util.Map.Entry other_element : other.failedExtents.entrySet()) { - + for (java.util.Map.Entry other_element : other.failedExtents.entrySet()) { + TKeyExtent other_element_key = other_element.getKey(); Long other_element_value = other_element.getValue(); - + TKeyExtent __this__failedExtents_copy_key = new TKeyExtent(other_element_key); - + Long __this__failedExtents_copy_value = other_element_value; - + __this__failedExtents.put(__this__failedExtents_copy_key, __this__failedExtents_copy_value); } this.failedExtents = __this__failedExtents; @@ -154,212 +144,212 @@ public class UpdateErrors implements TBa this.authorizationFailures = __this__authorizationFailures; } } - + public UpdateErrors deepCopy() { return new UpdateErrors(this); } - + @Deprecated public UpdateErrors clone() { return new UpdateErrors(this); } - + public int getFailedExtentsSize() { return (this.failedExtents == null) ? 0 : this.failedExtents.size(); } - + public void putToFailedExtents(TKeyExtent key, long val) { if (this.failedExtents == null) { this.failedExtents = new java.util.HashMap(); } this.failedExtents.put(key, val); } - + public java.util.Map getFailedExtents() { return this.failedExtents; } - + public UpdateErrors setFailedExtents(java.util.Map failedExtents) { this.failedExtents = failedExtents; return this; } - + public void unsetFailedExtents() { this.failedExtents = null; } - + /** Returns true if field failedExtents is set (has been asigned a value) and false otherwise */ public boolean isSetFailedExtents() { return this.failedExtents != null; } - + public void setFailedExtentsIsSet(boolean value) { if (!value) { this.failedExtents = null; } } - + public int getViolationSummariesSize() { return (this.violationSummaries == null) ? 0 : this.violationSummaries.size(); } - + public java.util.Iterator getViolationSummariesIterator() { return (this.violationSummaries == null) ? null : this.violationSummaries.iterator(); } - + public void addToViolationSummaries(TConstraintViolationSummary elem) { if (this.violationSummaries == null) { this.violationSummaries = new java.util.ArrayList(); } this.violationSummaries.add(elem); } - + public java.util.List getViolationSummaries() { return this.violationSummaries; } - + public UpdateErrors setViolationSummaries(java.util.List violationSummaries) { this.violationSummaries = violationSummaries; return this; } - + public void unsetViolationSummaries() { this.violationSummaries = null; } - + /** Returns true if field violationSummaries is set (has been asigned a value) and false otherwise */ public boolean isSetViolationSummaries() { return this.violationSummaries != null; } - + public void setViolationSummariesIsSet(boolean value) { if (!value) { this.violationSummaries = null; } } - + public int getAuthorizationFailuresSize() { return (this.authorizationFailures == null) ? 0 : this.authorizationFailures.size(); } - + public java.util.Iterator getAuthorizationFailuresIterator() { return (this.authorizationFailures == null) ? null : this.authorizationFailures.iterator(); } - + public void addToAuthorizationFailures(TKeyExtent elem) { if (this.authorizationFailures == null) { this.authorizationFailures = new java.util.ArrayList(); } this.authorizationFailures.add(elem); } - + public java.util.List getAuthorizationFailures() { return this.authorizationFailures; } - + public UpdateErrors setAuthorizationFailures(java.util.List authorizationFailures) { this.authorizationFailures = authorizationFailures; return this; } - + public void unsetAuthorizationFailures() { this.authorizationFailures = null; } - + /** Returns true if field authorizationFailures is set (has been asigned a value) and false otherwise */ public boolean isSetAuthorizationFailures() { return this.authorizationFailures != null; } - + public void setAuthorizationFailuresIsSet(boolean value) { if (!value) { this.authorizationFailures = null; } } - + @SuppressWarnings("unchecked") public void setFieldValue(_Fields field, Object value) { switch (field) { - case FAILED_EXTENTS: - if (value == null) { - unsetFailedExtents(); - } else { - setFailedExtents((java.util.Map)value); - } - break; - - case VIOLATION_SUMMARIES: - if (value == null) { - unsetViolationSummaries(); - } else { - setViolationSummaries((java.util.List)value); - } - break; - - case AUTHORIZATION_FAILURES: - if (value == null) { - unsetAuthorizationFailures(); - } else { - setAuthorizationFailures((java.util.List)value); - } - break; - + case FAILED_EXTENTS: + if (value == null) { + unsetFailedExtents(); + } else { + setFailedExtents((java.util.Map) value); + } + break; + + case VIOLATION_SUMMARIES: + if (value == null) { + unsetViolationSummaries(); + } else { + setViolationSummaries((java.util.List) value); + } + break; + + case AUTHORIZATION_FAILURES: + if (value == null) { + unsetAuthorizationFailures(); + } else { + setAuthorizationFailures((java.util.List) value); + } + break; + } } - + public void setFieldValue(int fieldID, Object value) { setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value); } - + public Object getFieldValue(_Fields field) { switch (field) { - case FAILED_EXTENTS: - return getFailedExtents(); - - case VIOLATION_SUMMARIES: - return getViolationSummaries(); - - case AUTHORIZATION_FAILURES: - return getAuthorizationFailures(); - + case FAILED_EXTENTS: + return getFailedExtents(); + + case VIOLATION_SUMMARIES: + return getViolationSummaries(); + + case AUTHORIZATION_FAILURES: + return getAuthorizationFailures(); + } throw new IllegalStateException(); } - + public Object getFieldValue(int fieldId) { return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId)); } - + /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */ public boolean isSet(_Fields field) { switch (field) { - case FAILED_EXTENTS: - return isSetFailedExtents(); - case VIOLATION_SUMMARIES: - return isSetViolationSummaries(); - case AUTHORIZATION_FAILURES: - return isSetAuthorizationFailures(); + case FAILED_EXTENTS: + return isSetFailedExtents(); + case VIOLATION_SUMMARIES: + return isSetViolationSummaries(); + case AUTHORIZATION_FAILURES: + return isSetAuthorizationFailures(); } throw new IllegalStateException(); } - + public boolean isSet(int fieldID) { return isSet(_Fields.findByThriftIdOrThrow(fieldID)); } - + @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof UpdateErrors) - return this.equals((UpdateErrors)that); + return this.equals((UpdateErrors) that); return false; } - + public boolean equals(UpdateErrors that) { if (that == null) return false; - + boolean this_present_failedExtents = true && this.isSetFailedExtents(); boolean that_present_failedExtents = true && that.isSetFailedExtents(); if (this_present_failedExtents || that_present_failedExtents) { @@ -368,7 +358,7 @@ public class UpdateErrors implements TBa if (!this.failedExtents.equals(that.failedExtents)) return false; } - + boolean this_present_violationSummaries = true && this.isSetViolationSummaries(); boolean that_present_violationSummaries = true && that.isSetViolationSummaries(); if (this_present_violationSummaries || that_present_violationSummaries) { @@ -377,7 +367,7 @@ public class UpdateErrors implements TBa if (!this.violationSummaries.equals(that.violationSummaries)) return false; } - + boolean this_present_authorizationFailures = true && this.isSetAuthorizationFailures(); boolean that_present_authorizationFailures = true && that.isSetAuthorizationFailures(); if (this_present_authorizationFailures || that_present_authorizationFailures) { @@ -386,28 +376,29 @@ public class UpdateErrors implements TBa if (!this.authorizationFailures.equals(that.authorizationFailures)) return false; } - + return true; } - + @Override public int hashCode() { return 0; } - + public int compareTo(UpdateErrors other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } - + int lastComparison = 0; - UpdateErrors typedOther = (UpdateErrors)other; - + UpdateErrors typedOther = (UpdateErrors) other; + lastComparison = Boolean.valueOf(isSetFailedExtents()).compareTo(typedOther.isSetFailedExtents()); if (lastComparison != 0) { return lastComparison; } - if (isSetFailedExtents()) { lastComparison = TBaseHelper.compareTo(this.failedExtents, typedOther.failedExtents); + if (isSetFailedExtents()) { + lastComparison = TBaseHelper.compareTo(this.failedExtents, typedOther.failedExtents); if (lastComparison != 0) { return lastComparison; } @@ -416,7 +407,8 @@ public class UpdateErrors implements TBa if (lastComparison != 0) { return lastComparison; } - if (isSetViolationSummaries()) { lastComparison = TBaseHelper.compareTo(this.violationSummaries, typedOther.violationSummaries); + if (isSetViolationSummaries()) { + lastComparison = TBaseHelper.compareTo(this.violationSummaries, typedOther.violationSummaries); if (lastComparison != 0) { return lastComparison; } @@ -425,21 +417,21 @@ public class UpdateErrors implements TBa if (lastComparison != 0) { return lastComparison; } - if (isSetAuthorizationFailures()) { lastComparison = TBaseHelper.compareTo(this.authorizationFailures, typedOther.authorizationFailures); + if (isSetAuthorizationFailures()) { + lastComparison = TBaseHelper.compareTo(this.authorizationFailures, typedOther.authorizationFailures); if (lastComparison != 0) { return lastComparison; } } return 0; } - + public void read(TProtocol iprot) throws TException { TField field; iprot.readStructBegin(); - while (true) - { + while (true) { field = iprot.readFieldBegin(); - if (field.type == TType.STOP) { + if (field.type == TType.STOP) { break; } switch (field.id) { @@ -447,9 +439,8 @@ public class UpdateErrors implements TBa if (field.type == TType.MAP) { { TMap _map25 = iprot.readMapBegin(); - this.failedExtents = new java.util.HashMap(2*_map25.size); - for (int _i26 = 0; _i26 < _map25.size; ++_i26) - { + this.failedExtents = new java.util.HashMap(2 * _map25.size); + for (int _i26 = 0; _i26 < _map25.size; ++_i26) { TKeyExtent _key27; long _val28; _key27 = new TKeyExtent(); @@ -459,7 +450,7 @@ public class UpdateErrors implements TBa } iprot.readMapEnd(); } - } else { + } else { TProtocolUtil.skip(iprot, field.type); } break; @@ -468,8 +459,7 @@ public class UpdateErrors implements TBa { TList _list29 = iprot.readListBegin(); this.violationSummaries = new java.util.ArrayList(_list29.size); - for (int _i30 = 0; _i30 < _list29.size; ++_i30) - { + for (int _i30 = 0; _i30 < _list29.size; ++_i30) { TConstraintViolationSummary _elem31; _elem31 = new TConstraintViolationSummary(); _elem31.read(iprot); @@ -477,7 +467,7 @@ public class UpdateErrors implements TBa } iprot.readListEnd(); } - } else { + } else { TProtocolUtil.skip(iprot, field.type); } break; @@ -486,8 +476,7 @@ public class UpdateErrors implements TBa { TList _list32 = iprot.readListBegin(); this.authorizationFailures = new java.util.ArrayList(_list32.size); - for (int _i33 = 0; _i33 < _list32.size; ++_i33) - { + for (int _i33 = 0; _i33 < _list32.size; ++_i33) { TKeyExtent _elem34; _elem34 = new TKeyExtent(); _elem34.read(iprot); @@ -495,7 +484,7 @@ public class UpdateErrors implements TBa } iprot.readListEnd(); } - } else { + } else { TProtocolUtil.skip(iprot, field.type); } break; @@ -505,21 +494,20 @@ public class UpdateErrors implements TBa iprot.readFieldEnd(); } iprot.readStructEnd(); - + // check for required fields of primitive type, which can't be checked in the validate method validate(); } - + public void write(TProtocol oprot) throws TException { validate(); - + oprot.writeStructBegin(STRUCT_DESC); if (this.failedExtents != null) { oprot.writeFieldBegin(FAILED_EXTENTS_FIELD_DESC); { oprot.writeMapBegin(new TMap(TType.STRUCT, TType.I64, this.failedExtents.size())); - for (java.util.Map.Entry _iter35 : this.failedExtents.entrySet()) - { + for (java.util.Map.Entry _iter35 : this.failedExtents.entrySet()) { _iter35.getKey().write(oprot); oprot.writeI64(_iter35.getValue()); } @@ -531,8 +519,7 @@ public class UpdateErrors implements TBa oprot.writeFieldBegin(VIOLATION_SUMMARIES_FIELD_DESC); { oprot.writeListBegin(new TList(TType.STRUCT, this.violationSummaries.size())); - for (TConstraintViolationSummary _iter36 : this.violationSummaries) - { + for (TConstraintViolationSummary _iter36 : this.violationSummaries) { _iter36.write(oprot); } oprot.writeListEnd(); @@ -543,8 +530,7 @@ public class UpdateErrors implements TBa oprot.writeFieldBegin(AUTHORIZATION_FAILURES_FIELD_DESC); { oprot.writeListBegin(new TList(TType.STRUCT, this.authorizationFailures.size())); - for (TKeyExtent _iter37 : this.authorizationFailures) - { + for (TKeyExtent _iter37 : this.authorizationFailures) { _iter37.write(oprot); } oprot.writeListEnd(); @@ -554,7 +540,7 @@ public class UpdateErrors implements TBa oprot.writeFieldStop(); oprot.writeStructEnd(); } - + @Override public String toString() { StringBuilder sb = new StringBuilder("UpdateErrors("); @@ -581,10 +567,9 @@ public class UpdateErrors implements TBa sb.append(")"); return sb.toString(); } - + public void validate() throws TException { // check for required fields } - + } - Modified: incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/file/BloomFilterLayer.java URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/file/BloomFilterLayer.java?rev=1189806&r1=1189805&r2=1189806&view=diff ============================================================================== --- incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/file/BloomFilterLayer.java (original) +++ incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/file/BloomFilterLayer.java Thu Oct 27 15:24:51 2011 @@ -142,13 +142,15 @@ public class BloomFilterLayer { public synchronized void append(org.apache.accumulo.core.data.Key key, Value val) throws IOException { writer.append(key, val); Key bloomKey = transformer.transform(key); - if (bloomKey.getBytes().length > 0) bloomFilter.add(bloomKey); + if (bloomKey.getBytes().length > 0) + bloomFilter.add(bloomKey); } @Override public synchronized void close() throws IOException { - if (closed) return; + if (closed) + return; DataOutputStream out = writer.createMetaStore(BLOOM_FILE_NAME); out.writeUTF(transformer.getClass().getCanonicalName()); @@ -198,7 +200,8 @@ public class BloomFilterLayer { public void run() { // no need to load the bloom filter if the map file is closed - if (closed) return; + if (closed) + return; String ClassName = null; DataInputStream in = null; @@ -207,7 +210,8 @@ public class BloomFilterLayer { DynamicBloomFilter tmpBloomFilter = new DynamicBloomFilter(); // check for closed again after open but before reading the bloom filter in - if (closed) return; + if (closed) + return; /** * Load classname for keyFunctor @@ -227,8 +231,10 @@ public class BloomFilterLayer { } catch (NoSuchMetaStoreException nsme) { // file does not have a bloom filter, ignore it } catch (IOException ioe) { - if (!closed) LOG.warn("Can't open BloomFilter", ioe); - else LOG.debug("Can't open BloomFilter, file closed : " + ioe.getMessage()); + if (!closed) + LOG.warn("Can't open BloomFilter", ioe); + else + LOG.debug("Can't open BloomFilter, file closed : " + ioe.getMessage()); bloomFilter = null; } catch (ClassNotFoundException e) { @@ -241,8 +247,10 @@ public class BloomFilterLayer { LOG.error("Illegal acess exception", e); bloomFilter = null; } catch (NullPointerException npe) { - if (!closed) throw npe; - else LOG.debug("Can't open BloomFilter, NPE after closed ", npe); + if (!closed) + throw npe; + else + LOG.debug("Can't open BloomFilter, NPE after closed ", npe); } finally { if (in != null) { @@ -294,12 +302,14 @@ public class BloomFilterLayer { boolean probablyHasKey(Range range) throws IOException { if (bloomFilter == null) { initiateLoad(); - if (bloomFilter == null) return true; + if (bloomFilter == null) + return true; } Key bloomKey = transformer.transform(range); - if (bloomKey == null || bloomKey.getBytes().length == 0) return true; + if (bloomKey == null || bloomKey.getBytes().length == 0) + return true; return bloomFilter.membershipTest(bloomKey); } Modified: incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/file/FileOperations.java URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/file/FileOperations.java?rev=1189806&r1=1189805&r2=1189806&view=diff ============================================================================== --- incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/file/FileOperations.java (original) +++ incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/file/FileOperations.java Thu Oct 27 15:24:51 2011 @@ -101,8 +101,10 @@ class DispatchingFileFactory extends Fil public FileSKVIterator openReader(String file, Range range, Set columnFamilies, boolean inclusive, FileSystem fs, Configuration conf, AccumuloConfiguration tableConf, BlockCache dataCache, BlockCache indexCache) throws IOException { - if (!tableConf.getBoolean(Property.TABLE_INDEXCACHE_ENABLED)) indexCache = null; - if (!tableConf.getBoolean(Property.TABLE_BLOCKCACHE_ENABLED)) dataCache = null; + if (!tableConf.getBoolean(Property.TABLE_INDEXCACHE_ENABLED)) + indexCache = null; + if (!tableConf.getBoolean(Property.TABLE_BLOCKCACHE_ENABLED)) + dataCache = null; return findFileFactory(file).openReader(file, range, columnFamilies, inclusive, fs, conf, tableConf, dataCache, indexCache); } @@ -111,8 +113,10 @@ class DispatchingFileFactory extends Fil public FileSKVIterator openReader(String file, boolean seekToBeginning, FileSystem fs, Configuration conf, AccumuloConfiguration acuconf, BlockCache dataCache, BlockCache indexCache) throws IOException { - if (!acuconf.getBoolean(Property.TABLE_INDEXCACHE_ENABLED)) indexCache = null; - if (!acuconf.getBoolean(Property.TABLE_BLOCKCACHE_ENABLED)) dataCache = null; + if (!acuconf.getBoolean(Property.TABLE_INDEXCACHE_ENABLED)) + indexCache = null; + if (!acuconf.getBoolean(Property.TABLE_BLOCKCACHE_ENABLED)) + dataCache = null; FileSKVIterator iter = findFileFactory(file).openReader(file, seekToBeginning, fs, conf, acuconf, dataCache, indexCache); if (acuconf.getBoolean(Property.TABLE_BLOOM_ENABLED)) { @@ -125,8 +129,10 @@ class DispatchingFileFactory extends Fil public FileSKVIterator openIndex(String file, FileSystem fs, Configuration conf, AccumuloConfiguration acuconf, BlockCache dCache, BlockCache iCache) throws IOException { - if (!acuconf.getBoolean(Property.TABLE_INDEXCACHE_ENABLED)) iCache = null; - if (!acuconf.getBoolean(Property.TABLE_BLOCKCACHE_ENABLED)) dCache = null; + if (!acuconf.getBoolean(Property.TABLE_INDEXCACHE_ENABLED)) + iCache = null; + if (!acuconf.getBoolean(Property.TABLE_BLOCKCACHE_ENABLED)) + dCache = null; return findFileFactory(file).openIndex(file, fs, conf, acuconf, dCache, iCache); } Modified: incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/file/FileUtil.java URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/file/FileUtil.java?rev=1189806&r1=1189805&r2=1189806&view=diff ============================================================================== --- incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/file/FileUtil.java (original) +++ incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/file/FileUtil.java Thu Oct 27 15:24:51 2011 @@ -90,7 +90,8 @@ public class FileUtil { fs.mkdirs(new Path(tmpDir)); // try to reserve the tmp dir - if (!fs.createNewFile(new Path(tmpDir + "/__reserve"))) tmpDir = null; + if (!fs.createNewFile(new Path(tmpDir + "/__reserve"))) + tmpDir = null; } return tmpDir; @@ -100,7 +101,8 @@ public class FileUtil { String tmpDir, int pass) throws IOException { ArrayList paths = new ArrayList(mapFiles); - if (paths.size() <= maxFiles) return paths; + if (paths.size() <= maxFiles) + return paths; String newDir = String.format("%s/pass_%04d", tmpDir, pass); fs.mkdirs(new Path(newDir)); @@ -141,29 +143,34 @@ public class FileUtil { boolean gtPrevEndRow = prevEndRow == null || key.compareRow(prevEndRow) > 0; boolean lteEndRow = endRow == null || key.compareRow(endRow) <= 0; - if (gtPrevEndRow && lteEndRow) writer.append(key, new LongWritable(0)); + if (gtPrevEndRow && lteEndRow) + writer.append(key, new LongWritable(0)); - if (!lteEndRow) break; + if (!lteEndRow) + break; mmfi.next(); } } finally { try { - if (reader != null) reader.close(); + if (reader != null) + reader.close(); } catch (IOException e) { log.error(e, e); } for (SortedKeyValueIterator r : iters) try { - if (r != null) ((FileSKVIterator) r).close(); + if (r != null) + ((FileSKVIterator) r).close(); } catch (IOException e) { // continue closing log.error(e, e); } try { - if (writer != null) writer.close(); + if (writer != null) + writer.close(); } catch (IOException e) { log.error(e, e); throw e; @@ -202,7 +209,8 @@ public class FileUtil { log.debug("Finished reducing indexes for " + endRow + " " + prevEndRow + " in " + String.format("%6.2f secs", (t2 - t1) / 1000.0)); } - if (prevEndRow == null) prevEndRow = new Text(); + if (prevEndRow == null) + prevEndRow = new Text(); long numKeys = 0; @@ -265,7 +273,8 @@ public class FileUtil { try { if (mapFiles.size() > maxToOpen) { - if (!useIndex) throw new IOException("Cannot find mid point using data files, too many " + mapFiles.size()); + if (!useIndex) + throw new IOException("Cannot find mid point using data files, too many " + mapFiles.size()); tmpDir = createTmpDir(fs); log.debug("Too many indexes (" + mapFiles.size() + ") to open at once for " + endRow + " " + prevEndRow + ", reducing in tmpDir = " + tmpDir); @@ -277,7 +286,8 @@ public class FileUtil { log.debug("Finished reducing indexes for " + endRow + " " + prevEndRow + " in " + String.format("%6.2f secs", (t2 - t1) / 1000.0)); } - if (prevEndRow == null) prevEndRow = new Text(); + if (prevEndRow == null) + prevEndRow = new Text(); long t1 = System.currentTimeMillis(); @@ -316,7 +326,8 @@ public class FileUtil { keyBeforeMidPointPosition = keysRead - 1; } - if (lastKey == null) lastKey = new Key(); + if (lastKey == null) + lastKey = new Key(); lastKey.set(mmfi.getTopKey()); @@ -326,7 +337,8 @@ public class FileUtil { mmfi.next(); } - if (keyBeforeMidPoint != null) ret.put(keyBeforeMidPointPosition / (double) numKeys, keyBeforeMidPoint); + if (keyBeforeMidPoint != null) + ret.put(keyBeforeMidPointPosition / (double) numKeys, keyBeforeMidPoint); long t2 = System.currentTimeMillis(); @@ -352,7 +364,8 @@ public class FileUtil { // close all of the index sequence files for (FileSKVIterator r : readers) { try { - if (r != null) r.close(); + if (r != null) + r.close(); } catch (IOException e) { // okay, try to close the rest anyway log.error(e, e); @@ -361,8 +374,10 @@ public class FileUtil { if (tmpDir != null) { String tmpPrefix = AccumuloConfiguration.getSystemConfiguration().get(Property.INSTANCE_DFS_DIR) + "/tmp"; - if (tmpDir.startsWith(tmpPrefix)) fs.delete(new Path(tmpDir), true); - else log.error("Did not delete tmp dir because it wasn't a tmp dir " + tmpDir); + if (tmpDir.startsWith(tmpPrefix)) + fs.delete(new Path(tmpDir), true); + else + log.error("Did not delete tmp dir because it wasn't a tmp dir " + tmpDir); } } @@ -375,28 +390,35 @@ public class FileUtil { for (String path : mapFiles) { FileSKVIterator reader = null; try { - if (useIndex) reader = FileOperations.getInstance().openIndex(path, fs, conf, acuconf); - else reader = FileOperations.getInstance().openReader(path, new Range(prevEndRow, false, null, true), LocalityGroupUtil.EMPTY_CF_SET, false, fs, conf, - acuconf); + if (useIndex) + reader = FileOperations.getInstance().openIndex(path, fs, conf, acuconf); + else + reader = FileOperations.getInstance().openReader(path, new Range(prevEndRow, false, null, true), LocalityGroupUtil.EMPTY_CF_SET, false, fs, conf, + acuconf); while (reader.hasTop()) { Key key = reader.getTopKey(); - if (endRow != null && key.compareRow(endRow) > 0) break; - else if (prevEndRow == null || key.compareRow(prevEndRow) > 0) numKeys++; + if (endRow != null && key.compareRow(endRow) > 0) + break; + else if (prevEndRow == null || key.compareRow(prevEndRow) > 0) + numKeys++; reader.next(); } } finally { try { - if (reader != null) reader.close(); + if (reader != null) + reader.close(); } catch (IOException e) { log.error(e, e); } } - if (useIndex) readers.add(FileOperations.getInstance().openIndex(path, fs, conf, acuconf)); - else readers.add(FileOperations.getInstance().openReader(path, new Range(prevEndRow, false, null, true), LocalityGroupUtil.EMPTY_CF_SET, false, fs, conf, - acuconf)); + if (useIndex) + readers.add(FileOperations.getInstance().openIndex(path, fs, conf, acuconf)); + else + readers.add(FileOperations.getInstance().openReader(path, new Range(prevEndRow, false, null, true), LocalityGroupUtil.EMPTY_CF_SET, false, fs, conf, + acuconf)); } return numKeys; @@ -458,15 +480,17 @@ public class FileUtil { try { if (!reader.hasTop()) - // file is empty, so there is no last key - continue; + // file is empty, so there is no last key + continue; Key key = reader.getLastKey(); - if (lastKey == null || key.compareTo(lastKey) > 0) lastKey = key; + if (lastKey == null || key.compareTo(lastKey) > 0) + lastKey = key; } finally { try { - if (reader != null) reader.close(); + if (reader != null) + reader.close(); } catch (IOException e) { log.error(e, e); } @@ -503,13 +527,15 @@ public class FileUtil { key.getRow(row); for (Entry entry : counts.entrySet()) - if (entry.getKey().contains(row)) entry.getValue().l++; + if (entry.getKey().contains(row)) + entry.getValue().l++; index.next(); } } finally { try { - if (index != null) index.close(); + if (index != null) + index.close(); } catch (IOException e) { // continue with next file log.error(e, e); @@ -519,7 +545,8 @@ public class FileUtil { Map results = new TreeMap(); for (KeyExtent keyExtent : extents) { double numEntries = counts.get(keyExtent).l; - if (numEntries == 0) numEntries = 1; + if (numEntries == 0) + numEntries = 1; long estSize = (long) ((numEntries / totalIndexEntries) * fileSize); results.put(keyExtent, estSize); } Modified: incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/CachedBlock.java URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/CachedBlock.java?rev=1189806&r1=1189805&r2=1189806&view=diff ============================================================================== --- incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/CachedBlock.java (original) +++ incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/CachedBlock.java Thu Oct 27 15:24:51 2011 @@ -83,7 +83,8 @@ public class CachedBlock implements Heap } public int compareTo(CachedBlock that) { - if (this.accessTime == that.accessTime) return 0; + if (this.accessTime == that.accessTime) + return 0; return this.accessTime < that.accessTime ? 1 : -1; } Modified: incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/CachedBlockQueue.java URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/CachedBlockQueue.java?rev=1189806&r1=1189805&r2=1189806&view=diff ============================================================================== --- incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/CachedBlockQueue.java (original) +++ incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/CachedBlockQueue.java Thu Oct 27 15:24:51 2011 @@ -48,7 +48,8 @@ public class CachedBlockQueue implements */ public CachedBlockQueue(long maxSize, long blockSize) { int initialSize = (int) Math.ceil(maxSize / blockSize); - if (initialSize == 0) initialSize++; + if (initialSize == 0) + initialSize++; queue = new PriorityQueue(initialSize); heapSize = 0; this.maxSize = maxSize;