Return-Path: X-Original-To: apmail-accumulo-commits-archive@www.apache.org Delivered-To: apmail-accumulo-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 45032E5A0 for ; Mon, 14 Jan 2013 22:05:01 +0000 (UTC) Received: (qmail 78881 invoked by uid 500); 14 Jan 2013 22:05:01 -0000 Delivered-To: apmail-accumulo-commits-archive@accumulo.apache.org Received: (qmail 78853 invoked by uid 500); 14 Jan 2013 22:05:01 -0000 Mailing-List: contact commits-help@accumulo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@accumulo.apache.org Delivered-To: mailing list commits@accumulo.apache.org Received: (qmail 78846 invoked by uid 99); 14 Jan 2013 22:05:01 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 14 Jan 2013 22:05:01 +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; Mon, 14 Jan 2013 22:04:45 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id F06DF2388C2D; Mon, 14 Jan 2013 22:03:59 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1433166 [8/20] - in /accumulo/branches/ACCUMULO-259: ./ assemble/ assemble/platform/ assemble/scripts/ assemble/scripts/init.d/ bin/ conf/examples/1GB/native-standalone/ conf/examples/1GB/standalone/ conf/examples/2GB/native-standalone/ co... Date: Mon, 14 Jan 2013 22:03:34 -0000 To: commits@accumulo.apache.org From: vines@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20130114220359.F06DF2388C2D@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Modified: accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/tabletserver/thrift/TabletStats.java URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/tabletserver/thrift/TabletStats.java?rev=1433166&r1=1433165&r2=1433166&view=diff ============================================================================== --- accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/tabletserver/thrift/TabletStats.java (original) +++ accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/tabletserver/thrift/TabletStats.java Mon Jan 14 22:03:24 2013 @@ -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) * @@ -34,9 +50,9 @@ import org.slf4j.LoggerFactory; private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TabletStats"); private static final org.apache.thrift.protocol.TField EXTENT_FIELD_DESC = new org.apache.thrift.protocol.TField("extent", org.apache.thrift.protocol.TType.STRUCT, (short)1); - private static final org.apache.thrift.protocol.TField MAJOR_FIELD_DESC = new org.apache.thrift.protocol.TField("major", org.apache.thrift.protocol.TType.STRUCT, (short)2); - private static final org.apache.thrift.protocol.TField MINOR_FIELD_DESC = new org.apache.thrift.protocol.TField("minor", org.apache.thrift.protocol.TType.STRUCT, (short)3); - private static final org.apache.thrift.protocol.TField SPLIT_FIELD_DESC = new org.apache.thrift.protocol.TField("split", org.apache.thrift.protocol.TType.STRUCT, (short)4); + private static final org.apache.thrift.protocol.TField MAJORS_FIELD_DESC = new org.apache.thrift.protocol.TField("majors", org.apache.thrift.protocol.TType.STRUCT, (short)2); + private static final org.apache.thrift.protocol.TField MINORS_FIELD_DESC = new org.apache.thrift.protocol.TField("minors", org.apache.thrift.protocol.TType.STRUCT, (short)3); + private static final org.apache.thrift.protocol.TField SPLITS_FIELD_DESC = new org.apache.thrift.protocol.TField("splits", org.apache.thrift.protocol.TType.STRUCT, (short)4); private static final org.apache.thrift.protocol.TField NUM_ENTRIES_FIELD_DESC = new org.apache.thrift.protocol.TField("numEntries", org.apache.thrift.protocol.TType.I64, (short)5); private static final org.apache.thrift.protocol.TField INGEST_RATE_FIELD_DESC = new org.apache.thrift.protocol.TField("ingestRate", org.apache.thrift.protocol.TType.DOUBLE, (short)6); private static final org.apache.thrift.protocol.TField QUERY_RATE_FIELD_DESC = new org.apache.thrift.protocol.TField("queryRate", org.apache.thrift.protocol.TType.DOUBLE, (short)7); @@ -49,9 +65,9 @@ import org.slf4j.LoggerFactory; } public org.apache.accumulo.core.data.thrift.TKeyExtent extent; // required - public ActionStats major; // required - public ActionStats minor; // required - public ActionStats split; // required + public ActionStats majors; // required + public ActionStats minors; // required + public ActionStats splits; // required public long numEntries; // required public double ingestRate; // required public double queryRate; // required @@ -60,9 +76,9 @@ import org.slf4j.LoggerFactory; /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum { EXTENT((short)1, "extent"), - MAJOR((short)2, "major"), - MINOR((short)3, "minor"), - SPLIT((short)4, "split"), + MAJORS((short)2, "majors"), + MINORS((short)3, "minors"), + SPLITS((short)4, "splits"), NUM_ENTRIES((short)5, "numEntries"), INGEST_RATE((short)6, "ingestRate"), QUERY_RATE((short)7, "queryRate"), @@ -83,12 +99,12 @@ import org.slf4j.LoggerFactory; switch(fieldId) { case 1: // EXTENT return EXTENT; - case 2: // MAJOR - return MAJOR; - case 3: // MINOR - return MINOR; - case 4: // SPLIT - return SPLIT; + case 2: // MAJORS + return MAJORS; + case 3: // MINORS + return MINORS; + case 4: // SPLITS + return SPLITS; case 5: // NUM_ENTRIES return NUM_ENTRIES; case 6: // INGEST_RATE @@ -147,11 +163,11 @@ import org.slf4j.LoggerFactory; Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.EXTENT, new org.apache.thrift.meta_data.FieldMetaData("extent", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, org.apache.accumulo.core.data.thrift.TKeyExtent.class))); - tmpMap.put(_Fields.MAJOR, new org.apache.thrift.meta_data.FieldMetaData("major", org.apache.thrift.TFieldRequirementType.DEFAULT, + tmpMap.put(_Fields.MAJORS, new org.apache.thrift.meta_data.FieldMetaData("majors", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ActionStats.class))); - tmpMap.put(_Fields.MINOR, new org.apache.thrift.meta_data.FieldMetaData("minor", org.apache.thrift.TFieldRequirementType.DEFAULT, + tmpMap.put(_Fields.MINORS, new org.apache.thrift.meta_data.FieldMetaData("minors", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ActionStats.class))); - tmpMap.put(_Fields.SPLIT, new org.apache.thrift.meta_data.FieldMetaData("split", org.apache.thrift.TFieldRequirementType.DEFAULT, + tmpMap.put(_Fields.SPLITS, new org.apache.thrift.meta_data.FieldMetaData("splits", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ActionStats.class))); tmpMap.put(_Fields.NUM_ENTRIES, new org.apache.thrift.meta_data.FieldMetaData("numEntries", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); @@ -170,9 +186,9 @@ import org.slf4j.LoggerFactory; public TabletStats( org.apache.accumulo.core.data.thrift.TKeyExtent extent, - ActionStats major, - ActionStats minor, - ActionStats split, + ActionStats majors, + ActionStats minors, + ActionStats splits, long numEntries, double ingestRate, double queryRate, @@ -180,9 +196,9 @@ import org.slf4j.LoggerFactory; { this(); this.extent = extent; - this.major = major; - this.minor = minor; - this.split = split; + this.majors = majors; + this.minors = minors; + this.splits = splits; this.numEntries = numEntries; setNumEntriesIsSet(true); this.ingestRate = ingestRate; @@ -201,14 +217,14 @@ import org.slf4j.LoggerFactory; if (other.isSetExtent()) { this.extent = new org.apache.accumulo.core.data.thrift.TKeyExtent(other.extent); } - if (other.isSetMajor()) { - this.major = new ActionStats(other.major); + if (other.isSetMajors()) { + this.majors = new ActionStats(other.majors); } - if (other.isSetMinor()) { - this.minor = new ActionStats(other.minor); + if (other.isSetMinors()) { + this.minors = new ActionStats(other.minors); } - if (other.isSetSplit()) { - this.split = new ActionStats(other.split); + if (other.isSetSplits()) { + this.splits = new ActionStats(other.splits); } this.numEntries = other.numEntries; this.ingestRate = other.ingestRate; @@ -223,9 +239,9 @@ import org.slf4j.LoggerFactory; @Override public void clear() { this.extent = null; - this.major = null; - this.minor = null; - this.split = null; + this.majors = null; + this.minors = null; + this.splits = null; setNumEntriesIsSet(false); this.numEntries = 0; setIngestRateIsSet(false); @@ -260,75 +276,75 @@ import org.slf4j.LoggerFactory; } } - public ActionStats getMajor() { - return this.major; + public ActionStats getMajors() { + return this.majors; } - public TabletStats setMajor(ActionStats major) { - this.major = major; + public TabletStats setMajors(ActionStats majors) { + this.majors = majors; return this; } - public void unsetMajor() { - this.major = null; + public void unsetMajors() { + this.majors = null; } - /** Returns true if field major is set (has been assigned a value) and false otherwise */ - public boolean isSetMajor() { - return this.major != null; + /** Returns true if field majors is set (has been assigned a value) and false otherwise */ + public boolean isSetMajors() { + return this.majors != null; } - public void setMajorIsSet(boolean value) { + public void setMajorsIsSet(boolean value) { if (!value) { - this.major = null; + this.majors = null; } } - public ActionStats getMinor() { - return this.minor; + public ActionStats getMinors() { + return this.minors; } - public TabletStats setMinor(ActionStats minor) { - this.minor = minor; + public TabletStats setMinors(ActionStats minors) { + this.minors = minors; return this; } - public void unsetMinor() { - this.minor = null; + public void unsetMinors() { + this.minors = null; } - /** Returns true if field minor is set (has been assigned a value) and false otherwise */ - public boolean isSetMinor() { - return this.minor != null; + /** Returns true if field minors is set (has been assigned a value) and false otherwise */ + public boolean isSetMinors() { + return this.minors != null; } - public void setMinorIsSet(boolean value) { + public void setMinorsIsSet(boolean value) { if (!value) { - this.minor = null; + this.minors = null; } } - public ActionStats getSplit() { - return this.split; + public ActionStats getSplits() { + return this.splits; } - public TabletStats setSplit(ActionStats split) { - this.split = split; + public TabletStats setSplits(ActionStats splits) { + this.splits = splits; return this; } - public void unsetSplit() { - this.split = null; + public void unsetSplits() { + this.splits = null; } - /** Returns true if field split is set (has been assigned a value) and false otherwise */ - public boolean isSetSplit() { - return this.split != null; + /** Returns true if field splits is set (has been assigned a value) and false otherwise */ + public boolean isSetSplits() { + return this.splits != null; } - public void setSplitIsSet(boolean value) { + public void setSplitsIsSet(boolean value) { if (!value) { - this.split = null; + this.splits = null; } } @@ -434,27 +450,27 @@ import org.slf4j.LoggerFactory; } break; - case MAJOR: + case MAJORS: if (value == null) { - unsetMajor(); + unsetMajors(); } else { - setMajor((ActionStats)value); + setMajors((ActionStats)value); } break; - case MINOR: + case MINORS: if (value == null) { - unsetMinor(); + unsetMinors(); } else { - setMinor((ActionStats)value); + setMinors((ActionStats)value); } break; - case SPLIT: + case SPLITS: if (value == null) { - unsetSplit(); + unsetSplits(); } else { - setSplit((ActionStats)value); + setSplits((ActionStats)value); } break; @@ -498,14 +514,14 @@ import org.slf4j.LoggerFactory; case EXTENT: return getExtent(); - case MAJOR: - return getMajor(); + case MAJORS: + return getMajors(); - case MINOR: - return getMinor(); + case MINORS: + return getMinors(); - case SPLIT: - return getSplit(); + case SPLITS: + return getSplits(); case NUM_ENTRIES: return Long.valueOf(getNumEntries()); @@ -532,12 +548,12 @@ import org.slf4j.LoggerFactory; switch (field) { case EXTENT: return isSetExtent(); - case MAJOR: - return isSetMajor(); - case MINOR: - return isSetMinor(); - case SPLIT: - return isSetSplit(); + case MAJORS: + return isSetMajors(); + case MINORS: + return isSetMinors(); + case SPLITS: + return isSetSplits(); case NUM_ENTRIES: return isSetNumEntries(); case INGEST_RATE: @@ -572,30 +588,30 @@ import org.slf4j.LoggerFactory; return false; } - boolean this_present_major = true && this.isSetMajor(); - boolean that_present_major = true && that.isSetMajor(); - if (this_present_major || that_present_major) { - if (!(this_present_major && that_present_major)) + boolean this_present_majors = true && this.isSetMajors(); + boolean that_present_majors = true && that.isSetMajors(); + if (this_present_majors || that_present_majors) { + if (!(this_present_majors && that_present_majors)) return false; - if (!this.major.equals(that.major)) + if (!this.majors.equals(that.majors)) return false; } - boolean this_present_minor = true && this.isSetMinor(); - boolean that_present_minor = true && that.isSetMinor(); - if (this_present_minor || that_present_minor) { - if (!(this_present_minor && that_present_minor)) + boolean this_present_minors = true && this.isSetMinors(); + boolean that_present_minors = true && that.isSetMinors(); + if (this_present_minors || that_present_minors) { + if (!(this_present_minors && that_present_minors)) return false; - if (!this.minor.equals(that.minor)) + if (!this.minors.equals(that.minors)) return false; } - boolean this_present_split = true && this.isSetSplit(); - boolean that_present_split = true && that.isSetSplit(); - if (this_present_split || that_present_split) { - if (!(this_present_split && that_present_split)) + boolean this_present_splits = true && this.isSetSplits(); + boolean that_present_splits = true && that.isSetSplits(); + if (this_present_splits || that_present_splits) { + if (!(this_present_splits && that_present_splits)) return false; - if (!this.split.equals(that.split)) + if (!this.splits.equals(that.splits)) return false; } @@ -661,32 +677,32 @@ import org.slf4j.LoggerFactory; return lastComparison; } } - lastComparison = Boolean.valueOf(isSetMajor()).compareTo(typedOther.isSetMajor()); + lastComparison = Boolean.valueOf(isSetMajors()).compareTo(typedOther.isSetMajors()); if (lastComparison != 0) { return lastComparison; } - if (isSetMajor()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.major, typedOther.major); + if (isSetMajors()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.majors, typedOther.majors); if (lastComparison != 0) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetMinor()).compareTo(typedOther.isSetMinor()); + lastComparison = Boolean.valueOf(isSetMinors()).compareTo(typedOther.isSetMinors()); if (lastComparison != 0) { return lastComparison; } - if (isSetMinor()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.minor, typedOther.minor); + if (isSetMinors()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.minors, typedOther.minors); if (lastComparison != 0) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetSplit()).compareTo(typedOther.isSetSplit()); + lastComparison = Boolean.valueOf(isSetSplits()).compareTo(typedOther.isSetSplits()); if (lastComparison != 0) { return lastComparison; } - if (isSetSplit()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.split, typedOther.split); + if (isSetSplits()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.splits, typedOther.splits); if (lastComparison != 0) { return lastComparison; } @@ -759,27 +775,27 @@ import org.slf4j.LoggerFactory; } first = false; if (!first) sb.append(", "); - sb.append("major:"); - if (this.major == null) { + sb.append("majors:"); + if (this.majors == null) { sb.append("null"); } else { - sb.append(this.major); + sb.append(this.majors); } first = false; if (!first) sb.append(", "); - sb.append("minor:"); - if (this.minor == null) { + sb.append("minors:"); + if (this.minors == null) { sb.append("null"); } else { - sb.append(this.minor); + sb.append(this.minors); } first = false; if (!first) sb.append(", "); - sb.append("split:"); - if (this.split == null) { + sb.append("splits:"); + if (this.splits == null) { sb.append("null"); } else { - sb.append(this.split); + sb.append(this.splits); } first = false; if (!first) sb.append(", "); @@ -808,14 +824,14 @@ import org.slf4j.LoggerFactory; if (extent != null) { extent.validate(); } - if (major != null) { - major.validate(); + if (majors != null) { + majors.validate(); } - if (minor != null) { - minor.validate(); + if (minors != null) { + minors.validate(); } - if (split != null) { - split.validate(); + if (splits != null) { + splits.validate(); } } @@ -864,29 +880,29 @@ import org.slf4j.LoggerFactory; org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; - case 2: // MAJOR + case 2: // MAJORS if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.major = new ActionStats(); - struct.major.read(iprot); - struct.setMajorIsSet(true); + struct.majors = new ActionStats(); + struct.majors.read(iprot); + struct.setMajorsIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; - case 3: // MINOR + case 3: // MINORS if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.minor = new ActionStats(); - struct.minor.read(iprot); - struct.setMinorIsSet(true); + struct.minors = new ActionStats(); + struct.minors.read(iprot); + struct.setMinorsIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; - case 4: // SPLIT + case 4: // SPLITS if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.split = new ActionStats(); - struct.split.read(iprot); - struct.setSplitIsSet(true); + struct.splits = new ActionStats(); + struct.splits.read(iprot); + struct.setSplitsIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } @@ -943,19 +959,19 @@ import org.slf4j.LoggerFactory; struct.extent.write(oprot); oprot.writeFieldEnd(); } - if (struct.major != null) { - oprot.writeFieldBegin(MAJOR_FIELD_DESC); - struct.major.write(oprot); + if (struct.majors != null) { + oprot.writeFieldBegin(MAJORS_FIELD_DESC); + struct.majors.write(oprot); oprot.writeFieldEnd(); } - if (struct.minor != null) { - oprot.writeFieldBegin(MINOR_FIELD_DESC); - struct.minor.write(oprot); + if (struct.minors != null) { + oprot.writeFieldBegin(MINORS_FIELD_DESC); + struct.minors.write(oprot); oprot.writeFieldEnd(); } - if (struct.split != null) { - oprot.writeFieldBegin(SPLIT_FIELD_DESC); - struct.split.write(oprot); + if (struct.splits != null) { + oprot.writeFieldBegin(SPLITS_FIELD_DESC); + struct.splits.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldBegin(NUM_ENTRIES_FIELD_DESC); @@ -991,13 +1007,13 @@ import org.slf4j.LoggerFactory; if (struct.isSetExtent()) { optionals.set(0); } - if (struct.isSetMajor()) { + if (struct.isSetMajors()) { optionals.set(1); } - if (struct.isSetMinor()) { + if (struct.isSetMinors()) { optionals.set(2); } - if (struct.isSetSplit()) { + if (struct.isSetSplits()) { optionals.set(3); } if (struct.isSetNumEntries()) { @@ -1016,14 +1032,14 @@ import org.slf4j.LoggerFactory; if (struct.isSetExtent()) { struct.extent.write(oprot); } - if (struct.isSetMajor()) { - struct.major.write(oprot); + if (struct.isSetMajors()) { + struct.majors.write(oprot); } - if (struct.isSetMinor()) { - struct.minor.write(oprot); + if (struct.isSetMinors()) { + struct.minors.write(oprot); } - if (struct.isSetSplit()) { - struct.split.write(oprot); + if (struct.isSetSplits()) { + struct.splits.write(oprot); } if (struct.isSetNumEntries()) { oprot.writeI64(struct.numEntries); @@ -1049,19 +1065,19 @@ import org.slf4j.LoggerFactory; struct.setExtentIsSet(true); } if (incoming.get(1)) { - struct.major = new ActionStats(); - struct.major.read(iprot); - struct.setMajorIsSet(true); + struct.majors = new ActionStats(); + struct.majors.read(iprot); + struct.setMajorsIsSet(true); } if (incoming.get(2)) { - struct.minor = new ActionStats(); - struct.minor.read(iprot); - struct.setMinorIsSet(true); + struct.minors = new ActionStats(); + struct.minors.read(iprot); + struct.setMinorsIsSet(true); } if (incoming.get(3)) { - struct.split = new ActionStats(); - struct.split.read(iprot); - struct.setSplitIsSet(true); + struct.splits = new ActionStats(); + struct.splits.read(iprot); + struct.setSplitsIsSet(true); } if (incoming.get(4)) { struct.numEntries = iprot.readI64(); Modified: accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/tabletserver/thrift/TooManyFilesException.java URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/tabletserver/thrift/TooManyFilesException.java?rev=1433166&r1=1433165&r2=1433166&view=diff ============================================================================== --- accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/tabletserver/thrift/TooManyFilesException.java (original) +++ accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/tabletserver/thrift/TooManyFilesException.java Mon Jan 14 22:03:24 2013 @@ -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) * Modified: accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/trace/InstanceUserPassword.java URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/trace/InstanceUserPassword.java?rev=1433166&r1=1433165&r2=1433166&view=diff ============================================================================== --- accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/trace/InstanceUserPassword.java (original) +++ accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/trace/InstanceUserPassword.java Mon Jan 14 22:03:24 2013 @@ -16,20 +16,16 @@ */ package org.apache.accumulo.core.trace; -import java.nio.charset.Charset; - import org.apache.accumulo.core.client.Instance; public class InstanceUserPassword { public Instance instance; public String username; public byte[] password; - - private static final Charset utf8 = Charset.forName("UTF8"); public InstanceUserPassword(Instance instance, String username, String password) { this.instance = instance; this.username = username; - this.password = password.getBytes(utf8); + this.password = password.getBytes(); } } Modified: accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/trace/TraceDump.java URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/trace/TraceDump.java?rev=1433166&r1=1433165&r2=1433166&view=diff ============================================================================== --- accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/trace/TraceDump.java (original) +++ accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/trace/TraceDump.java Mon Jan 14 22:03:24 2013 @@ -29,68 +29,51 @@ import java.util.Map.Entry; import java.util.Set; import org.apache.accumulo.cloudtrace.thrift.RemoteSpan; +import org.apache.accumulo.core.cli.ClientOnDefaultTable; +import org.apache.accumulo.core.cli.ScannerOpts; import org.apache.accumulo.core.client.Connector; import org.apache.accumulo.core.client.Scanner; -import org.apache.accumulo.core.client.ZooKeeperInstance; import org.apache.accumulo.core.data.Key; import org.apache.accumulo.core.data.Range; import org.apache.accumulo.core.data.Value; -import org.apache.commons.cli.BasicParser; -import org.apache.commons.cli.CommandLine; -import org.apache.commons.cli.Option; -import org.apache.commons.cli.Options; import org.apache.hadoop.io.Text; +import com.beust.jcommander.Parameter; + public class TraceDump { static final long DEFAULT_TIME_IN_MILLIS = 10 * 60 * 1000l; - private static final Options OPTIONS = new Options(); - public static final Option LIST_SPANS = new Option("l", "list", false, "List recent traces."); - public static final Option START_TIME = new Option("s", "start", true, "The start time of traces to display"); - public static final Option END_TIME = new Option("e", "end", true, "The end time of traces to display"); - public static final Option DUMP_TRACE = new Option("d", "dump", false, "Dump the traces"); - public static final Option INSTANCE_URL = new Option("i", "instance", true, "URL to point to accumulo."); - public static final String TRACE_TABLE = "trace"; - - static { - for (Option opt : new Option[] {LIST_SPANS, START_TIME, END_TIME, DUMP_TRACE, INSTANCE_URL}) { - OPTIONS.addOption(opt); - } + static class Opts extends ClientOnDefaultTable { + @Parameter(names={"-l", "--list"}, description="List recent traces") + boolean list = false; + @Parameter(names={"-s", "--start"}, description="The start time of traces to display") + String start; + @Parameter(names={"-e", "--end"}, description="The end time of traces to display") + String end; + @Parameter(names={"-d", "--dump"}, description="Dump the traces") + boolean dump = false; + @Parameter(names={"-i", "--instance"}, description="URL to point to accumulo.") + String instance; + @Parameter(description=" { ... }") + List traceIds = new ArrayList(); + Opts() { super("trace");} } public static void main(String[] args) throws Exception { - CommandLine commandLine = new BasicParser().parse(OPTIONS, args); + Opts opts = new Opts(); + ScannerOpts scanOpts = new ScannerOpts(); + opts.parseArgs(TraceDump.class.getName(), args, scanOpts); int code = 0; - if (code == 0 && commandLine.hasOption(LIST_SPANS.getLongOpt())) { - code = listSpans(commandLine); + if (opts.list) { + code = listSpans(opts, scanOpts); } - if (code == 0 && commandLine.hasOption(DUMP_TRACE.getLongOpt())) { - code = dumpTrace(commandLine); + if (code == 0 && opts.dump) { + code = dumpTrace(opts, scanOpts); } System.exit(code); } - public static InstanceUserPassword getInstance(CommandLine commandLine) { - InstanceUserPassword result = null; - String url = commandLine.getOptionValue(INSTANCE_URL.getOpt(), "zoo://root:secret@localhost/test"); - if (!url.startsWith("zoo://")) { - throw new IllegalArgumentException("Instance url must start with zoo://"); - } - String uri = url.substring(6); // root:secret@localhost/test - String parts[] = uri.split("@", 2); // root:secret, localhost/test - String userPass = parts[0]; - String zooInstance = parts[1]; - parts = userPass.split(":", 2); // root, secret - String user = parts[0]; - String password = parts[1]; - parts = zooInstance.split("/", 2); // localhost, test - String zoo = parts[0]; - String instance = parts[1]; - result = new InstanceUserPassword(new ZooKeeperInstance(instance, zoo), user, password); - return result; - } - public static List sortByStart(Collection spans) { List spanList = new ArrayList(spans); Collections.sort(spanList, new Comparator() { @@ -102,13 +85,13 @@ public class TraceDump { return spanList; } - private static int listSpans(CommandLine commandLine) throws Exception { + private static int listSpans(Opts opts, ScannerOpts scanOpts) throws Exception { PrintStream out = System.out; long endTime = System.currentTimeMillis(); long startTime = endTime - DEFAULT_TIME_IN_MILLIS; - InstanceUserPassword info = getInstance(commandLine); - Connector conn = info.instance.getConnector(info.username, info.password); - Scanner scanner = conn.createScanner(TRACE_TABLE, conn.securityOperations().getUserAuthorizations(info.username)); + Connector conn = opts.getConnector(); + Scanner scanner = conn.createScanner(opts.getTableName(), opts.auths); + scanner.setBatchSize(scanOpts.scanBatchSize); Range range = new Range(new Text("start:" + Long.toHexString(startTime)), new Text("start:" + Long.toHexString(endTime))); scanner.setRange(range); out.println("Trace Day/Time (ms) Start"); @@ -123,15 +106,15 @@ public class TraceDump { void print(String line); } - private static int dumpTrace(CommandLine commandLine) throws Exception { + private static int dumpTrace(Opts opts, ScannerOpts scanOpts) throws Exception { final PrintStream out = System.out; - InstanceUserPassword info = getInstance(commandLine); - Connector conn = info.instance.getConnector(info.username, info.password); + Connector conn = opts.getConnector(); int count = 0; - for (Object arg : commandLine.getArgList()) { - Scanner scanner = conn.createScanner(TRACE_TABLE, conn.securityOperations().getUserAuthorizations(info.username)); - Range range = new Range(new Text(arg.toString())); + for (String traceId : opts.traceIds) { + Scanner scanner = conn.createScanner(opts.getTableName(), opts.auths); + scanner.setBatchSize(scanOpts.scanBatchSize); + Range range = new Range(new Text(traceId.toString())); scanner.setRange(range); count = printTrace(scanner, new Printer() { @Override Modified: accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/util/ByteArraySet.java URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/util/ByteArraySet.java?rev=1433166&r1=1433165&r2=1433166&view=diff ============================================================================== --- accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/util/ByteArraySet.java (original) +++ accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/util/ByteArraySet.java Mon Jan 14 22:03:24 2013 @@ -16,7 +16,6 @@ */ package org.apache.accumulo.core.util; -import java.nio.charset.Charset; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; @@ -26,8 +25,6 @@ import java.util.TreeSet; public class ByteArraySet extends TreeSet { private static final long serialVersionUID = 1L; - - private static final Charset utf8 = Charset.forName("UTF8"); public ByteArraySet() { super(new ByteArrayComparator()); @@ -41,7 +38,7 @@ public class ByteArraySet extends TreeSe public static ByteArraySet fromStrings(Collection c) { List lst = new ArrayList(); for (String s : c) - lst.add(s.getBytes(utf8)); + lst.add(s.getBytes()); return new ByteArraySet(lst); } Modified: accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/util/Encoding.java URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/util/Encoding.java?rev=1433166&r1=1433165&r2=1433166&view=diff ============================================================================== --- accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/util/Encoding.java (original) +++ accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/util/Encoding.java Mon Jan 14 22:03:24 2013 @@ -16,14 +16,10 @@ */ package org.apache.accumulo.core.util; -import java.nio.charset.Charset; - import org.apache.commons.codec.binary.Base64; import org.apache.hadoop.io.Text; public class Encoding { - - private static final Charset utf8 = Charset.forName("UTF8"); public static String encodeAsBase64FileName(Text data) { String encodedRow = new String(Base64.encodeBase64(TextUtil.getBytes(data))); @@ -43,7 +39,7 @@ public class Encoding { node = node.replace('_', '/').replace('-', '+'); - return Base64.decodeBase64(node.getBytes(utf8)); + return Base64.decodeBase64(node.getBytes()); } } Modified: accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/util/LocalityGroupUtil.java URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/util/LocalityGroupUtil.java?rev=1433166&r1=1433165&r2=1433166&view=diff ============================================================================== --- accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/util/LocalityGroupUtil.java (original) +++ accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/util/LocalityGroupUtil.java Mon Jan 14 22:03:24 2013 @@ -39,7 +39,7 @@ public class LocalityGroupUtil { // private static final Logger log = Logger.getLogger(ColumnFamilySet.class); - public static Set EMPTY_CF_SET = Collections.emptySet(); + public static final Set EMPTY_CF_SET = Collections.emptySet(); public static Set families(Collection columns) { Set result = new HashSet(columns.size()); Modified: accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/util/LoggingRunnable.java URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/util/LoggingRunnable.java?rev=1433166&r1=1433165&r2=1433166&view=diff ============================================================================== --- accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/util/LoggingRunnable.java (original) +++ accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/util/LoggingRunnable.java Mon Jan 14 22:03:24 2013 @@ -46,20 +46,4 @@ public class LoggingRunnable implements } } } - - public static void main(String[] args) { - Runnable r = new Runnable() { - @Override - public void run() { - int x[] = new int[0]; - - x[0]++; - } - }; - - LoggingRunnable lr = new LoggingRunnable(null, r); - lr.run(); - - } - } Modified: accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/util/Merge.java URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/util/Merge.java?rev=1433166&r1=1433165&r2=1433166&view=diff ============================================================================== --- accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/util/Merge.java (original) +++ accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/util/Merge.java Mon Jan 14 22:03:24 2013 @@ -16,17 +16,15 @@ */ package org.apache.accumulo.core.util; -import java.nio.charset.Charset; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import java.util.Map.Entry; import org.apache.accumulo.core.Constants; +import org.apache.accumulo.core.cli.ClientOnRequiredTable; import org.apache.accumulo.core.client.Connector; -import org.apache.accumulo.core.client.Instance; import org.apache.accumulo.core.client.Scanner; -import org.apache.accumulo.core.client.ZooKeeperInstance; import org.apache.accumulo.core.client.impl.Tables; import org.apache.accumulo.core.conf.AccumuloConfiguration; import org.apache.accumulo.core.conf.ConfigurationCopy; @@ -34,13 +32,13 @@ import org.apache.accumulo.core.conf.Pro import org.apache.accumulo.core.data.Key; import org.apache.accumulo.core.data.KeyExtent; import org.apache.accumulo.core.data.Value; -import org.apache.commons.cli.BasicParser; -import org.apache.commons.cli.CommandLine; -import org.apache.commons.cli.Options; import org.apache.commons.cli.ParseException; import org.apache.hadoop.io.Text; import org.apache.log4j.Logger; +import com.beust.jcommander.IStringConverter; +import com.beust.jcommander.Parameter; + public class Merge { public static class MergeException extends Exception { @@ -53,80 +51,52 @@ public class Merge { private static final Logger log = Logger.getLogger(Merge.class); - private static final Charset utf8 = Charset.forName("UTF8"); - protected void message(String format, Object... args) { log.info(String.format(format, args)); } - public void start(String[] args) throws MergeException, ParseException { - String keepers = "localhost"; - String instance = "instance"; - String table = null; - long goalSize = -1; - String user = "root"; - byte[] password = "secret".getBytes(utf8); + static class MemoryConverter implements IStringConverter { + @Override + public Long convert(String value) { + return AccumuloConfiguration.getMemoryInBytes(value); + } + } + static class TextConverter implements IStringConverter { + @Override + public Text convert(String value) { + return new Text(value); + } + } + + static class Opts extends ClientOnRequiredTable { + @Parameter(names={"-s", "--size"}, description="merge goal size", converter=MemoryConverter.class) + Long goalSize = null; + @Parameter(names={"-f", "--force"}, description="merge small tablets even if merging them to larger tablets might cause a split") boolean force = false; + @Parameter(names={"-b", "--begin"}, description="start tablet", converter=TextConverter.class) Text begin = null; + @Parameter(names={"-e", "--end"}, description="end tablet", converter=TextConverter.class) Text end = null; + } + + public void start(String[] args) throws MergeException, ParseException { + Opts opts = new Opts(); + opts.parseArgs(Merge.class.getCanonicalName(), args); - Options options = new Options(); - options.addOption("k", "keepers", true, "ZooKeeper list"); - options.addOption("i", "instance", true, "instance name"); - options.addOption("t", "table", true, "table to merge"); - options.addOption("s", "size", true, "merge goal size"); - options.addOption("u", "user", true, "user"); - options.addOption("p", "password", true, "password"); - options.addOption("f", "force", false, "merge small tablets even if merging them to larger tablets might cause a split"); - options.addOption("b", "begin", true, "start tablet"); - options.addOption("e", "end", true, "end tablet"); - CommandLine commandLine = new BasicParser().parse(options, args); - if (commandLine.hasOption("k")) { - keepers = commandLine.getOptionValue("k"); - } - if (commandLine.hasOption("i")) { - instance = commandLine.getOptionValue("i"); - } - if (commandLine.hasOption("t")) { - table = commandLine.getOptionValue("t"); - } - if (commandLine.hasOption("s")) { - goalSize = AccumuloConfiguration.getMemoryInBytes(commandLine.getOptionValue("s")); - } - if (commandLine.hasOption("u")) { - table = commandLine.getOptionValue("u"); - } - if (commandLine.hasOption("p")) { - password = commandLine.getOptionValue("p").getBytes(utf8); - } - if (commandLine.hasOption("f")) { - force = true; - } - if (commandLine.hasOption("b")) { - begin = new Text(commandLine.getOptionValue("b")); - } - if (commandLine.hasOption("e")) { - end = new Text(commandLine.getOptionValue("e")); - } - if (table == null) { - System.err.println("Specify the table to merge"); - return; - } - Instance zki = new ZooKeeperInstance(instance, keepers); try { - Connector conn = zki.getConnector(user, password); + Connector conn = opts.getConnector(); - if (!conn.tableOperations().exists(table)) { - System.err.println("table " + table + " does not exist"); + if (!conn.tableOperations().exists(opts.tableName)) { + System.err.println("table " + opts.tableName + " does not exist"); return; } - if (goalSize < 1) { - AccumuloConfiguration tableConfig = new ConfigurationCopy(conn.tableOperations().getProperties(table)); - goalSize = tableConfig.getMemoryInBytes(Property.TABLE_SPLIT_THRESHOLD); + if (opts.goalSize == null || opts.goalSize < 1) { + AccumuloConfiguration tableConfig = new ConfigurationCopy(conn.tableOperations().getProperties(opts.tableName)); + opts.goalSize = tableConfig.getMemoryInBytes(Property.TABLE_SPLIT_THRESHOLD); } - message("Merging tablets in table %s to %d bytes", table, goalSize); - mergomatic(conn, table, begin, end, goalSize, force); + message("Merging tablets in table %s to %d bytes", opts.tableName, opts.goalSize); + mergomatic(conn, opts.tableName, opts.begin, opts.end, opts.goalSize, opts.force); } catch (Exception ex) { throw new MergeException(ex); } Modified: accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/util/MetadataTable.java URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/util/MetadataTable.java?rev=1433166&r1=1433165&r2=1433166&view=diff ============================================================================== --- accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/util/MetadataTable.java (original) +++ accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/util/MetadataTable.java Mon Jan 14 22:03:24 2013 @@ -16,7 +16,6 @@ */ package org.apache.accumulo.core.util; -import java.nio.charset.Charset; import java.util.ArrayList; import java.util.HashSet; import java.util.Iterator; @@ -48,8 +47,6 @@ public class MetadataTable { private long size; private long numEntries; private long time = -1; - - private static final Charset utf8 = Charset.forName("UTF8"); public DataFileValue(long size, long numEntries, long time) { this.size = size; @@ -93,8 +90,8 @@ public class MetadataTable { public byte[] encode() { if (time >= 0) - return ("" + size + "," + numEntries + "," + time).getBytes(utf8); - return ("" + size + "," + numEntries).getBytes(utf8); + return ("" + size + "," + numEntries + "," + time).getBytes(); + return ("" + size + "," + numEntries).getBytes(); } public boolean equals(Object o) { Modified: accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/util/ServerServices.java URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/util/ServerServices.java?rev=1433166&r1=1433165&r2=1433166&view=diff ============================================================================== --- accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/util/ServerServices.java (original) +++ accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/util/ServerServices.java Mon Jan 14 22:03:24 2013 @@ -41,8 +41,8 @@ public class ServerServices implements C } } - public static String SERVICE_SEPARATOR = ";"; - public static String SEPARATOR_CHAR = "="; + public static final String SERVICE_SEPARATOR = ";"; + public static final String SEPARATOR_CHAR = "="; private EnumMap services; private String stringForm = null; Modified: accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/util/SimpleThreadPool.java URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/util/SimpleThreadPool.java?rev=1433166&r1=1433165&r2=1433166&view=diff ============================================================================== --- accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/util/SimpleThreadPool.java (original) +++ accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/util/SimpleThreadPool.java Mon Jan 14 22:03:24 2013 @@ -27,7 +27,7 @@ import java.util.concurrent.TimeUnit; public class SimpleThreadPool extends ThreadPoolExecutor { public SimpleThreadPool(int max, final String name) { - super(max, max, 1l, TimeUnit.SECONDS, new LinkedBlockingQueue(), new NamingThreadFactory(name)); + super(max, max, 4l, TimeUnit.SECONDS, new LinkedBlockingQueue(), new NamingThreadFactory(name)); allowCoreThreadTimeOut(true); } Modified: accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/util/TextUtil.java URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/util/TextUtil.java?rev=1433166&r1=1433165&r2=1433166&view=diff ============================================================================== --- accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/util/TextUtil.java (original) +++ accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/util/TextUtil.java Mon Jan 14 22:03:24 2013 @@ -17,15 +17,11 @@ package org.apache.accumulo.core.util; import java.nio.ByteBuffer; -import java.nio.charset.Charset; import org.apache.accumulo.core.Constants; import org.apache.hadoop.io.Text; public final class TextUtil { - - private static final Charset utf8 = Charset.forName("UTF8"); - public static byte[] getBytes(Text text) { byte[] bytes = text.getBytes(); if (bytes.length != text.getLength()) { @@ -47,7 +43,7 @@ public final class TextUtil { Text newText = new Text(); newText.append(text.getBytes(), 0, maxLen); String suffix = "... TRUNCATED"; - newText.append(suffix.getBytes(utf8), 0, suffix.length()); + newText.append(suffix.getBytes(), 0, suffix.length()); return newText; } Modified: accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/util/shell/Shell.java URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/util/shell/Shell.java?rev=1433166&r1=1433165&r2=1433166&view=diff ============================================================================== --- accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/util/shell/Shell.java (original) +++ accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/util/shell/Shell.java Mon Jan 14 22:03:24 2013 @@ -22,7 +22,6 @@ import java.io.IOException; import java.io.PrintWriter; import java.net.InetAddress; import java.nio.ByteBuffer; -import java.nio.charset.Charset; import java.util.Arrays; import java.util.Collections; import java.util.HashMap; @@ -152,8 +151,6 @@ import org.apache.log4j.Logger; public class Shell extends ShellOptions { public static final Logger log = Logger.getLogger(Shell.class); private static final Logger audit = Logger.getLogger(Shell.class.getName() + ".audit"); - - private static final Charset utf8 = Charset.forName("UTF8"); public static final String CHARSET = "ISO-8859-1"; public static final int NO_FIXED_ARG_LENGTH_CHECK = -1; @@ -270,7 +267,7 @@ public class Shell extends ShellOptions return true; } // user canceled - pass = passw.getBytes(utf8); + pass = passw.getBytes(); this.setTableName(""); connector = instance.getConnector(user, pass); this.credentials = new AuthInfo(user, ByteBuffer.wrap(pass), connector.getInstance().getInstanceID()); @@ -511,7 +508,7 @@ public class Shell extends ShellOptions } // user canceled try { - authFailed = !connector.securityOperations().authenticateUser(connector.whoami(), pwd.getBytes(utf8)); + authFailed = !connector.securityOperations().authenticateUser(connector.whoami(), pwd.getBytes()); } catch (Exception e) { ++exitCode; printException(e); Modified: accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/util/shell/commands/ActiveScanIterator.java URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/util/shell/commands/ActiveScanIterator.java?rev=1433166&r1=1433165&r2=1433166&view=diff ============================================================================== --- accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/util/shell/commands/ActiveScanIterator.java (original) +++ accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/util/shell/commands/ActiveScanIterator.java Mon Jan 14 22:03:24 2013 @@ -42,9 +42,9 @@ class ActiveScanIterator implements Iter final List asl = instanceOps.getActiveScans(tserver); for (ActiveScan as : asl) { - scans.add(String.format("%21s |%21s |%9s |%9s |%7s |%6s |%8s |%8s |%10s |%10s |%10s | %s", tserver, as.getClient(), + scans.add(String.format("%21s |%21s |%9s |%9s |%7s |%6s |%8s |%8s |%10s |%20s |%10s |%10s | %s", tserver, as.getClient(), Duration.format(as.getAge(), "", "-"), Duration.format(as.getLastContactTime(), "", "-"), as.getState(), as.getType(), as.getUser(), - as.getTable(), as.getColumns(), (as.getType() == ScanType.SINGLE ? as.getExtent() : "N/A"), as.getSsiList(), as.getSsio())); + as.getTable(), as.getColumns(), as.getAuthorizations(), (as.getType() == ScanType.SINGLE ? as.getExtent() : "N/A"), as.getSsiList(), as.getSsio())); } } catch (Exception e) { scans.add(tserver + " ERROR " + e.getMessage()); @@ -62,8 +62,8 @@ class ActiveScanIterator implements Iter this.instanceOps = instanceOps; this.tsIter = tservers.iterator(); - final String header = String.format(" %-21s| %-21s| %-9s| %-9s| %-7s| %-6s| %-8s| %-8s| %-10s| %-10s| %-10s | %s", "TABLET SERVER", "CLIENT", "AGE", "LAST", - "STATE", "TYPE", "USER", "TABLE", "COLUMNS", "TABLET", "ITERATORS", "ITERATOR OPTIONS"); + final String header = String.format(" %-21s| %-21s| %-9s| %-9s| %-7s| %-6s| %-8s| %-8s| %-10s| %-20s| %-10s| %-10s | %s", "TABLET SERVER", "CLIENT", "AGE", + "LAST", "STATE", "TYPE", "USER", "TABLE", "COLUMNS", "AUTHORIZATIONS", "TABLET", "ITERATORS", "ITERATOR OPTIONS"); scansIter = Collections.singletonList(header).iterator(); } Modified: accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/util/shell/commands/AddSplitsCommand.java URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/util/shell/commands/AddSplitsCommand.java?rev=1433166&r1=1433165&r2=1433166&view=diff ============================================================================== --- accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/util/shell/commands/AddSplitsCommand.java (original) +++ accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/util/shell/commands/AddSplitsCommand.java Mon Jan 14 22:03:24 2013 @@ -17,7 +17,6 @@ package org.apache.accumulo.core.util.shell.commands; import java.io.File; -import java.nio.charset.Charset; import java.util.TreeSet; import org.apache.accumulo.core.client.TableNotFoundException; @@ -32,8 +31,6 @@ import org.apache.hadoop.io.Text; public class AddSplitsCommand extends Command { private Option optSplitsFile, base64Opt; - - private static final Charset utf8 = Charset.forName("UTF8"); public int execute(final String fullCommand, final CommandLine cl, final Shell shellState) throws Exception { final String tableName = OptUtil.getTableOpt(cl, shellState); @@ -49,7 +46,7 @@ public class AddSplitsCommand extends Co while (file.hasNextLine()) { line = file.nextLine(); if (!line.isEmpty()) { - splits.add(decode ? new Text(Base64.decodeBase64(line.getBytes(utf8))) : new Text(line)); + splits.add(decode ? new Text(Base64.decodeBase64(line.getBytes())) : new Text(line)); } } } else { Modified: accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/util/shell/commands/AuthenticateCommand.java URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/util/shell/commands/AuthenticateCommand.java?rev=1433166&r1=1433165&r2=1433166&view=diff ============================================================================== --- accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/util/shell/commands/AuthenticateCommand.java (original) +++ accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/util/shell/commands/AuthenticateCommand.java Mon Jan 14 22:03:24 2013 @@ -17,7 +17,6 @@ package org.apache.accumulo.core.util.shell.commands; import java.io.IOException; -import java.nio.charset.Charset; import java.util.Map; import java.util.Set; @@ -29,9 +28,6 @@ import org.apache.accumulo.core.util.she import org.apache.commons.cli.CommandLine; public class AuthenticateCommand extends Command { - - private static final Charset utf8 = Charset.forName("UTF8"); - @Override public int execute(final String fullCommand, final CommandLine cl, final Shell shellState) throws AccumuloException, AccumuloSecurityException, IOException { final String user = cl.getArgs()[0]; @@ -40,7 +36,7 @@ public class AuthenticateCommand extends shellState.getReader().printNewline(); return 0; } // user canceled - final byte[] password = p.getBytes(utf8); + final byte[] password = p.getBytes(); final boolean valid = shellState.getConnector().securityOperations().authenticateUser(user, password); shellState.getReader().printString((valid ? "V" : "Not v") + "alid\n"); return 0; Modified: accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/util/shell/commands/ClasspathCommand.java URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/util/shell/commands/ClasspathCommand.java?rev=1433166&r1=1433165&r2=1433166&view=diff ============================================================================== --- accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/util/shell/commands/ClasspathCommand.java (original) +++ accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/util/shell/commands/ClasspathCommand.java Mon Jan 14 22:03:24 2013 @@ -18,13 +18,13 @@ package org.apache.accumulo.core.util.sh import org.apache.accumulo.core.util.shell.Shell; import org.apache.accumulo.core.util.shell.Shell.Command; -import org.apache.accumulo.start.classloader.AccumuloClassLoader; +import org.apache.accumulo.start.classloader.vfs.AccumuloVFSClassLoader; import org.apache.commons.cli.CommandLine; public class ClasspathCommand extends Command { @Override public int execute(final String fullCommand, final CommandLine cl, final Shell shellState) { - AccumuloClassLoader.printClassPath(); + AccumuloVFSClassLoader.printClassPath(); return 0; } Modified: accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/util/shell/commands/CreateTableCommand.java URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/util/shell/commands/CreateTableCommand.java?rev=1433166&r1=1433165&r2=1433166&view=diff ============================================================================== --- accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/util/shell/commands/CreateTableCommand.java (original) +++ accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/util/shell/commands/CreateTableCommand.java Mon Jan 14 22:03:24 2013 @@ -18,7 +18,6 @@ package org.apache.accumulo.core.util.sh import java.io.File; import java.io.IOException; -import java.nio.charset.Charset; import java.util.Map.Entry; import java.util.Scanner; import java.util.SortedSet; @@ -53,8 +52,6 @@ public class CreateTableCommand extends private Option base64Opt; private Option createTableOptFormatter; public static String testTable; - - private static final Charset utf8 = Charset.forName("UTF8"); public int execute(final String fullCommand, final CommandLine cl, final Shell shellState) throws AccumuloException, AccumuloSecurityException, TableExistsException, TableNotFoundException, IOException, ClassNotFoundException { @@ -81,7 +78,7 @@ public class CreateTableCommand extends while (file.hasNextLine()) { line = file.nextLine(); if (!line.isEmpty()) { - partitions.add(decode ? new Text(Base64.decodeBase64(line.getBytes(utf8))) : new Text(line)); + partitions.add(decode ? new Text(Base64.decodeBase64(line.getBytes())) : new Text(line)); } } } else if (cl.hasOption(createTableOptCopySplits.getOpt())) { Modified: accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/util/shell/commands/CreateUserCommand.java URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/util/shell/commands/CreateUserCommand.java?rev=1433166&r1=1433165&r2=1433166&view=diff ============================================================================== --- accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/util/shell/commands/CreateUserCommand.java (original) +++ accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/util/shell/commands/CreateUserCommand.java Mon Jan 14 22:03:24 2013 @@ -17,32 +17,17 @@ package org.apache.accumulo.core.util.shell.commands; import java.io.IOException; -import java.nio.charset.Charset; -import org.apache.accumulo.core.Constants; import org.apache.accumulo.core.client.AccumuloException; import org.apache.accumulo.core.client.AccumuloSecurityException; import org.apache.accumulo.core.client.TableExistsException; import org.apache.accumulo.core.client.TableNotFoundException; -import org.apache.accumulo.core.security.Authorizations; import org.apache.accumulo.core.util.shell.Shell; import org.apache.accumulo.core.util.shell.Shell.Command; import org.apache.commons.cli.CommandLine; -import org.apache.commons.cli.Option; import org.apache.commons.cli.Options; -public class CreateUserCommand extends Command { - private Option scanOptAuths; - - private static final Charset utf8 = Charset.forName("UTF8"); - - static Authorizations parseAuthorizations(final String field) { - if (field == null || field.isEmpty()) { - return Constants.NO_AUTHS; - } - return new Authorizations(field.split(",")); - } - +public class CreateUserCommand extends Command { @Override public int execute(final String fullCommand, final CommandLine cl, final Shell shellState) throws AccumuloException, TableNotFoundException, AccumuloSecurityException, TableExistsException, IOException { @@ -62,10 +47,8 @@ public class CreateUserCommand extends C if (!password.equals(passwordConfirm)) { throw new IllegalArgumentException("Passwords do not match"); } - final Authorizations authorizations = parseAuthorizations(cl.hasOption(scanOptAuths.getOpt()) ? cl.getOptionValue(scanOptAuths.getOpt()) : ""); - shellState.getConnector().securityOperations().createUser(user, password.getBytes(utf8), authorizations); - Shell.log.debug("Created user " + user + " with" + (authorizations.isEmpty() ? " no" : "") + " initial scan authorizations" - + (!authorizations.isEmpty() ? " " + authorizations : "")); + shellState.getConnector().securityOperations().createUser(user, password.getBytes()); + Shell.log.debug("Created user " + user); return 0; } @@ -82,9 +65,6 @@ public class CreateUserCommand extends C @Override public Options getOptions() { final Options o = new Options(); - scanOptAuths = new Option("s", "scan-authorizations", true, "scan authorizations"); - scanOptAuths.setArgName("comma-separated-authorizations"); - o.addOption(scanOptAuths); return o; } Modified: accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/util/shell/commands/HiddenCommand.java URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/util/shell/commands/HiddenCommand.java?rev=1433166&r1=1433165&r2=1433166&view=diff ============================================================================== --- accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/util/shell/commands/HiddenCommand.java (original) +++ accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/util/shell/commands/HiddenCommand.java Mon Jan 14 22:03:24 2013 @@ -16,7 +16,6 @@ */ package org.apache.accumulo.core.util.shell.commands; -import java.nio.charset.Charset; import java.security.SecureRandom; import java.util.Random; @@ -29,8 +28,6 @@ import org.apache.commons.codec.binary.B public class HiddenCommand extends Command { private static Random rand = new SecureRandom(); - - private static final Charset utf8 = Charset.forName("UTF8"); @Override public String description() { @@ -45,7 +42,7 @@ public class HiddenCommand extends Comma shellState.getReader().printString( new String(Base64.decodeBase64(("ICAgICAgIC4tLS4KICAgICAgLyAvXCBcCiAgICAgKCAvLS1cICkKICAgICAuPl8gIF88LgogICAgLyB8ICd8ICcgXAog" + "ICAvICB8Xy58Xy4gIFwKICAvIC98ICAgICAgfFwgXAogfCB8IHwgfFwvfCB8IHwgfAogfF98IHwgfCAgfCB8IHxffAogICAgIC8gIF9fICBcCiAgICAvICAv" - + "ICBcICBcCiAgIC8gIC8gICAgXCAgXF8KIHwvICAvICAgICAgXCB8IHwKIHxfXy8gICAgICAgIFx8X3wK").getBytes(utf8)))); + + "ICBcICBcCiAgIC8gIC8gICAgXCAgXF8KIHwvICAvICAgICAgXCB8IHwKIHxfXy8gICAgICAgIFx8X3wK").getBytes()))); shellState.getReader().printNewline(); } else { throw new ShellCommandException(ErrorCode.UNRECOGNIZED_COMMAND, getName()); Modified: accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/util/shell/commands/InsertCommand.java URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/util/shell/commands/InsertCommand.java?rev=1433166&r1=1433165&r2=1433166&view=diff ============================================================================== --- accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/util/shell/commands/InsertCommand.java (original) +++ accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/util/shell/commands/InsertCommand.java Mon Jan 14 22:03:24 2013 @@ -18,6 +18,8 @@ package org.apache.accumulo.core.util.sh import java.io.IOException; import java.util.ArrayList; +import java.util.Map.Entry; +import java.util.Set; import java.util.concurrent.TimeUnit; import org.apache.accumulo.core.client.AccumuloException; @@ -32,6 +34,7 @@ import org.apache.accumulo.core.data.Key import org.apache.accumulo.core.data.Mutation; import org.apache.accumulo.core.data.Value; import org.apache.accumulo.core.security.ColumnVisibility; +import org.apache.accumulo.core.security.thrift.SecurityErrorCode; import org.apache.accumulo.core.tabletserver.thrift.ConstraintViolationException; import org.apache.accumulo.core.util.shell.Shell; import org.apache.accumulo.core.util.shell.Shell.Command; @@ -84,8 +87,8 @@ public class InsertCommand extends Comma if (e.getAuthorizationFailures().isEmpty() == false) { lines.add(" Authorization Failures:"); } - for (KeyExtent extent : e.getAuthorizationFailures()) { - lines.add(" " + extent); + for (Entry> entry : e.getAuthorizationFailures().entrySet()) { + lines.add(" " + entry); } if (e.getConstraintViolationSummaries().isEmpty() == false) { lines.add(" Constraint Failures:"); Modified: accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/util/shell/commands/MergeCommand.java URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/util/shell/commands/MergeCommand.java?rev=1433166&r1=1433165&r2=1433166&view=diff ============================================================================== --- accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/util/shell/commands/MergeCommand.java (original) +++ accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/util/shell/commands/MergeCommand.java Mon Jan 14 22:03:24 2013 @@ -47,6 +47,14 @@ public class MergeCommand extends Comman if (cl.hasOption(sizeOpt.getOpt())) { size = AccumuloConfiguration.getMemoryInBytes(cl.getOptionValue(sizeOpt.getOpt())); } + if (startRow == null && endRow == null && size < 0) { + shellState.getReader().flushConsole(); + String line = shellState.getReader().readLine("Merge the entire table { " + tableName + " } into one tablet (yes|no)? "); + if (line == null) + return 0; + if (!line.equalsIgnoreCase("y") && !line.equalsIgnoreCase("yes")) + return 0; + } if (size < 0) { shellState.getConnector().tableOperations().merge(tableName, startRow, endRow); } else { Modified: accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/util/shell/commands/PasswdCommand.java URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/util/shell/commands/PasswdCommand.java?rev=1433166&r1=1433165&r2=1433166&view=diff ============================================================================== --- accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/util/shell/commands/PasswdCommand.java (original) +++ accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/util/shell/commands/PasswdCommand.java Mon Jan 14 22:03:24 2013 @@ -18,7 +18,6 @@ package org.apache.accumulo.core.util.sh import java.io.IOException; import java.nio.ByteBuffer; -import java.nio.charset.Charset; import org.apache.accumulo.core.client.AccumuloException; import org.apache.accumulo.core.client.AccumuloSecurityException; @@ -32,8 +31,6 @@ import org.apache.commons.cli.Options; public class PasswdCommand extends Command { private Option userOpt; - - private static final Charset utf8 = Charset.forName("UTF8"); @Override public int execute(final String fullCommand, final CommandLine cl, final Shell shellState) throws AccumuloException, AccumuloSecurityException, IOException { @@ -50,7 +47,7 @@ public class PasswdCommand extends Comma return 0; } // user canceled - if (!shellState.getConnector().securityOperations().authenticateUser(currentUser, oldPassword.getBytes(utf8))) + if (!shellState.getConnector().securityOperations().authenticateUser(currentUser, oldPassword.getBytes())) throw new AccumuloSecurityException(user, SecurityErrorCode.BAD_CREDENTIALS); password = shellState.readMaskedLine("Enter new password for '" + user + "': ", '*'); @@ -67,7 +64,7 @@ public class PasswdCommand extends Comma if (!password.equals(passwordConfirm)) { throw new IllegalArgumentException("Passwords do not match"); } - byte[] pass = password.getBytes(utf8); + byte[] pass = password.getBytes(); shellState.getConnector().securityOperations().changeUserPassword(user, pass); // update the current credentials if the password changed was for // the current user Modified: accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/util/shell/commands/QuotedStringTokenizer.java URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/util/shell/commands/QuotedStringTokenizer.java?rev=1433166&r1=1433165&r2=1433166&view=diff ============================================================================== --- accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/util/shell/commands/QuotedStringTokenizer.java (original) +++ accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/util/shell/commands/QuotedStringTokenizer.java Mon Jan 14 22:03:24 2013 @@ -17,7 +17,6 @@ package org.apache.accumulo.core.util.shell.commands; import java.io.UnsupportedEncodingException; -import java.nio.charset.Charset; import java.util.ArrayList; import java.util.Iterator; @@ -35,8 +34,6 @@ import org.apache.accumulo.core.util.she public class QuotedStringTokenizer implements Iterable { private ArrayList tokens; private String input; - - private static final Charset utf8 = Charset.forName("UTF8"); public QuotedStringTokenizer(final String t) throws BadArgumentException { tokens = new ArrayList(); @@ -60,7 +57,7 @@ public class QuotedStringTokenizer imple final byte[] token = new byte[input.length()]; int tokenLength = 0; - final byte[] inputBytes = input.getBytes(utf8); + final byte[] inputBytes = input.getBytes(); for (int i = 0; i < input.length(); ++i) { final char ch = input.charAt(i); Modified: accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/util/shell/commands/ScanCommand.java URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/util/shell/commands/ScanCommand.java?rev=1433166&r1=1433165&r2=1433166&view=diff ============================================================================== --- accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/util/shell/commands/ScanCommand.java (original) +++ accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/util/shell/commands/ScanCommand.java Mon Jan 14 22:03:24 2013 @@ -22,6 +22,7 @@ import java.util.List; import java.util.Map.Entry; import java.util.concurrent.TimeUnit; +import org.apache.accumulo.core.Constants; import org.apache.accumulo.core.client.AccumuloException; import org.apache.accumulo.core.client.AccumuloSecurityException; import org.apache.accumulo.core.client.IteratorSetting; @@ -39,7 +40,7 @@ import org.apache.accumulo.core.util.int import org.apache.accumulo.core.util.shell.Shell; import org.apache.accumulo.core.util.shell.Shell.Command; import org.apache.accumulo.core.util.shell.Shell.PrintFile; -import org.apache.accumulo.start.classloader.AccumuloClassLoader; +import org.apache.accumulo.start.classloader.vfs.AccumuloVFSClassLoader; import org.apache.commons.cli.CommandLine; import org.apache.commons.cli.Option; import org.apache.commons.cli.Options; @@ -166,9 +167,9 @@ public class ScanCommand extends Command Class clazz = null; try { if (cl.hasOption(interpreterOpt.getOpt())) { - clazz = AccumuloClassLoader.loadClass(cl.getOptionValue(interpreterOpt.getOpt()), ScanInterpreter.class); + clazz = AccumuloVFSClassLoader.loadClass(cl.getOptionValue(interpreterOpt.getOpt()), ScanInterpreter.class); } else if (cl.hasOption(formatterInterpeterOpt.getOpt())) { - clazz = AccumuloClassLoader.loadClass(cl.getOptionValue(formatterInterpeterOpt.getOpt()), ScanInterpreter.class); + clazz = AccumuloVFSClassLoader.loadClass(cl.getOptionValue(formatterInterpeterOpt.getOpt()), ScanInterpreter.class); } } catch (ClassNotFoundException e) { shellState.getReader().printString("Interpreter class could not be loaded.\n" + e.getMessage() + "\n"); @@ -187,10 +188,10 @@ public class ScanCommand extends Command try { if (cl.hasOption(formatterOpt.getOpt())) { - return AccumuloClassLoader.loadClass(cl.getOptionValue(formatterOpt.getOpt()), Formatter.class); + return AccumuloVFSClassLoader.loadClass(cl.getOptionValue(formatterOpt.getOpt()), Formatter.class); } else if (cl.hasOption(formatterInterpeterOpt.getOpt())) { - return AccumuloClassLoader.loadClass(cl.getOptionValue(formatterInterpeterOpt.getOpt()), Formatter.class); + return AccumuloVFSClassLoader.loadClass(cl.getOptionValue(formatterInterpeterOpt.getOpt()), Formatter.class); } } catch (ClassNotFoundException e) { shellState.getReader().printString("Formatter class could not be loaded.\n" + e.getMessage() + "\n"); @@ -239,11 +240,18 @@ public class ScanCommand extends Command final String user = shellState.getConnector().whoami(); Authorizations auths = shellState.getConnector().securityOperations().getUserAuthorizations(user); if (cl.hasOption(scanOptAuths.getOpt())) { - auths = CreateUserCommand.parseAuthorizations(cl.getOptionValue(scanOptAuths.getOpt())); + auths = ScanCommand.parseAuthorizations(cl.getOptionValue(scanOptAuths.getOpt())); } return auths; } + static Authorizations parseAuthorizations(final String field) { + if (field == null || field.isEmpty()) { + return Constants.NO_AUTHS; + } + return new Authorizations(field.split(",")); + } + @Override public String description() { return "scans the table, and displays the resulting records"; Modified: accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/util/shell/commands/SetAuthsCommand.java URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/util/shell/commands/SetAuthsCommand.java?rev=1433166&r1=1433165&r2=1433166&view=diff ============================================================================== --- accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/util/shell/commands/SetAuthsCommand.java (original) +++ accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/util/shell/commands/SetAuthsCommand.java Mon Jan 14 22:03:24 2013 @@ -38,7 +38,7 @@ public class SetAuthsCommand extends Com public int execute(final String fullCommand, final CommandLine cl, final Shell shellState) throws AccumuloException, AccumuloSecurityException { final String user = cl.getOptionValue(userOpt.getOpt(), shellState.getConnector().whoami()); final String scanOpts = cl.hasOption(clearOptAuths.getOpt()) ? null : cl.getOptionValue(scanOptAuths.getOpt()); - shellState.getConnector().securityOperations().changeUserAuthorizations(user, CreateUserCommand.parseAuthorizations(scanOpts)); + shellState.getConnector().securityOperations().changeUserAuthorizations(user, ScanCommand.parseAuthorizations(scanOpts)); Shell.log.debug("Changed record-level authorizations for user " + user); return 0; } Modified: accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/util/shell/commands/SetIterCommand.java URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/util/shell/commands/SetIterCommand.java?rev=1433166&r1=1433165&r2=1433166&view=diff ============================================================================== --- accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/util/shell/commands/SetIterCommand.java (original) +++ accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/util/shell/commands/SetIterCommand.java Mon Jan 14 22:03:24 2013 @@ -43,7 +43,7 @@ import org.apache.accumulo.core.util.she import org.apache.accumulo.core.util.shell.Shell.Command; import org.apache.accumulo.core.util.shell.ShellCommandException; import org.apache.accumulo.core.util.shell.ShellCommandException.ErrorCode; -import org.apache.accumulo.start.classloader.AccumuloClassLoader; +import org.apache.accumulo.start.classloader.vfs.AccumuloVFSClassLoader; import org.apache.commons.cli.CommandLine; import org.apache.commons.cli.Option; import org.apache.commons.cli.OptionGroup; @@ -123,7 +123,7 @@ public class SetIterCommand extends Comm OptionDescriber skvi; Class clazz; try { - clazz = AccumuloClassLoader.loadClass(className, OptionDescriber.class); + clazz = AccumuloVFSClassLoader.loadClass(className, OptionDescriber.class); skvi = clazz.newInstance(); } catch (ClassNotFoundException e) { throw new IllegalArgumentException(e.getMessage()); Modified: accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/util/shell/commands/ShellPluginConfigurationCommand.java URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/util/shell/commands/ShellPluginConfigurationCommand.java?rev=1433166&r1=1433165&r2=1433166&view=diff ============================================================================== --- accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/util/shell/commands/ShellPluginConfigurationCommand.java (original) +++ accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/util/shell/commands/ShellPluginConfigurationCommand.java Mon Jan 14 22:03:24 2013 @@ -25,7 +25,7 @@ import org.apache.accumulo.core.client.T import org.apache.accumulo.core.conf.Property; import org.apache.accumulo.core.util.shell.Shell; import org.apache.accumulo.core.util.shell.Shell.Command; -import org.apache.accumulo.start.classloader.AccumuloClassLoader; +import org.apache.accumulo.start.classloader.vfs.AccumuloVFSClassLoader; import org.apache.commons.cli.CommandLine; import org.apache.commons.cli.Option; import org.apache.commons.cli.OptionGroup; @@ -102,7 +102,7 @@ public abstract class ShellPluginConfigu if (ent.getKey().equals(pluginProp.toString())) { Class pluginClazz; try { - pluginClazz = AccumuloClassLoader.loadClass(ent.getValue(), clazz); + pluginClazz = AccumuloVFSClassLoader.loadClass(ent.getValue(), clazz); } catch (ClassNotFoundException e) { Logger.getLogger(ShellPluginConfigurationCommand.class).warn("Class not found" + e.getMessage()); return null; Modified: accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/util/shell/commands/UserCommand.java URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/util/shell/commands/UserCommand.java?rev=1433166&r1=1433165&r2=1433166&view=diff ============================================================================== --- accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/util/shell/commands/UserCommand.java (original) +++ accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/util/shell/commands/UserCommand.java Mon Jan 14 22:03:24 2013 @@ -18,7 +18,6 @@ package org.apache.accumulo.core.util.sh import java.io.IOException; import java.nio.ByteBuffer; -import java.nio.charset.Charset; import java.util.Map; import java.util.Set; @@ -31,9 +30,6 @@ import org.apache.accumulo.core.util.she import org.apache.commons.cli.CommandLine; public class UserCommand extends Command { - - private static final Charset utf8 = Charset.forName("UTF8"); - public int execute(final String fullCommand, final CommandLine cl, final Shell shellState) throws AccumuloException, AccumuloSecurityException, IOException { // save old credentials and connection in case of failure String user = cl.getArgs()[0]; @@ -47,7 +43,7 @@ public class UserCommand extends Command shellState.getReader().printNewline(); return 0; } // user canceled - pass = p.getBytes(utf8); + pass = p.getBytes(); shellState.updateUser(new AuthInfo(user, ByteBuffer.wrap(pass), shellState.getConnector().getInstance().getInstanceID())); return 0; } Modified: accumulo/branches/ACCUMULO-259/core/src/main/thrift/client.thrift URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/thrift/client.thrift?rev=1433166&r1=1433165&r2=1433166&view=diff ============================================================================== --- accumulo/branches/ACCUMULO-259/core/src/main/thrift/client.thrift (original) +++ accumulo/branches/ACCUMULO-259/core/src/main/thrift/client.thrift Mon Jan 14 22:03:24 2013 @@ -15,6 +15,7 @@ * limitations under the License. */ namespace java org.apache.accumulo.core.client.impl.thrift +namespace cpp org.apache.accumulo.core.client.impl.thrift include "security.thrift" include "cloudtrace.thrift" Modified: accumulo/branches/ACCUMULO-259/core/src/main/thrift/data.thrift URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/thrift/data.thrift?rev=1433166&r1=1433165&r2=1433166&view=diff ============================================================================== --- accumulo/branches/ACCUMULO-259/core/src/main/thrift/data.thrift (original) +++ accumulo/branches/ACCUMULO-259/core/src/main/thrift/data.thrift Mon Jan 14 22:03:24 2013 @@ -15,6 +15,9 @@ * limitations under the License. */ namespace java org.apache.accumulo.core.data.thrift +namespace cpp org.apache.accumulo.core.data.thrift + +include "security.thrift" typedef i64 ScanID typedef i64 UpdateID @@ -103,7 +106,7 @@ struct TConstraintViolationSummary { struct UpdateErrors { 1:map failedExtents, 2:list violationSummaries, - 3:list authorizationFailures + 3:map authorizationFailures } struct MapFileInfo { Modified: accumulo/branches/ACCUMULO-259/core/src/main/thrift/gc.thrift URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/thrift/gc.thrift?rev=1433166&r1=1433165&r2=1433166&view=diff ============================================================================== --- accumulo/branches/ACCUMULO-259/core/src/main/thrift/gc.thrift (original) +++ accumulo/branches/ACCUMULO-259/core/src/main/thrift/gc.thrift Mon Jan 14 22:03:24 2013 @@ -15,6 +15,7 @@ * limitations under the License. */ namespace java org.apache.accumulo.core.gc.thrift +namespace cpp org.apache.accumulo.core.gc.thrift include "security.thrift" include "cloudtrace.thrift" Modified: accumulo/branches/ACCUMULO-259/core/src/main/thrift/master.thrift URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/thrift/master.thrift?rev=1433166&r1=1433165&r2=1433166&view=diff ============================================================================== --- accumulo/branches/ACCUMULO-259/core/src/main/thrift/master.thrift (original) +++ accumulo/branches/ACCUMULO-259/core/src/main/thrift/master.thrift Mon Jan 14 22:03:24 2013 @@ -15,6 +15,7 @@ * limitations under the License. */ namespace java org.apache.accumulo.core.master.thrift +namespace cpp org.apache.accumulo.core.master.thrift include "data.thrift" include "security.thrift" @@ -35,8 +36,8 @@ struct TableInfo { 6:double ingestByteRate 7:double queryRate 8:double queryByteRate - 9:Compacting minor; - 10:Compacting major; + 9:Compacting minors; + 10:Compacting majors; 11:Compacting scans; 12:double scanRate; } Modified: accumulo/branches/ACCUMULO-259/core/src/main/thrift/security.thrift URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/thrift/security.thrift?rev=1433166&r1=1433165&r2=1433166&view=diff ============================================================================== --- accumulo/branches/ACCUMULO-259/core/src/main/thrift/security.thrift (original) +++ accumulo/branches/ACCUMULO-259/core/src/main/thrift/security.thrift Mon Jan 14 22:03:24 2013 @@ -15,6 +15,7 @@ * limitations under the License. */ namespace java org.apache.accumulo.core.security.thrift +namespace cpp org.apache.accumulo.core.security.thrift enum SecurityErrorCode { DEFAULT_SECURITY_ERROR = 0, Modified: accumulo/branches/ACCUMULO-259/core/src/main/thrift/tabletserver.thrift URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/thrift/tabletserver.thrift?rev=1433166&r1=1433165&r2=1433166&view=diff ============================================================================== --- accumulo/branches/ACCUMULO-259/core/src/main/thrift/tabletserver.thrift (original) +++ accumulo/branches/ACCUMULO-259/core/src/main/thrift/tabletserver.thrift Mon Jan 14 22:03:24 2013 @@ -15,6 +15,7 @@ * limitations under the License. */ namespace java org.apache.accumulo.core.tabletserver.thrift +namespace cpp org.apache.accumulo.core.tabletserver.thrift include "data.thrift" include "security.thrift" @@ -50,9 +51,9 @@ struct ActionStats { struct TabletStats { 1:data.TKeyExtent extent - 2:ActionStats major - 3:ActionStats minor - 4:ActionStats split + 2:ActionStats majors + 3:ActionStats minors + 4:ActionStats splits 5:i64 numEntries 6:double ingestRate 7:double queryRate @@ -83,6 +84,7 @@ struct ActiveScan { 10:list columns 11:list ssiList 12:map> ssio /* Server Side Iterator Options */ + 13:list authorizations } struct TIteratorSetting {