Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,14 @@
*
*/
public class MutationsRejectedException extends AccumuloException {
private static final String EXCEPTIONS = " # exceptions ";

private static final String SERVER_ERRORS = " # server errors ";

private static final String SECURITY_CODES = " security codes: ";

private static final String CONSTRAINT_VIOLATIONS = "# constraint violations : ";

private static final long serialVersionUID = 1L;

private List<ConstraintViolationSummary> cvsl;
Expand Down Expand Up @@ -70,8 +78,8 @@ private static <K,V,L> Map<L,V> transformKeys(Map<K,V> map, Function<K,L> keyFun
@Deprecated
public MutationsRejectedException(List<ConstraintViolationSummary> cvsList, HashMap<org.apache.accumulo.core.data.KeyExtent,Set<SecurityErrorCode>> hashMap,
Collection<String> serverSideErrors, int unknownErrors, Throwable cause) {
super("# constraint violations : " + cvsList.size() + " security codes: " + hashMap.values() + " # server errors " + serverSideErrors.size()
+ " # exceptions " + unknownErrors, cause);
super(CONSTRAINT_VIOLATIONS + cvsList.size() + SECURITY_CODES + hashMap.values() + SERVER_ERRORS + serverSideErrors.size()
+ EXCEPTIONS + unknownErrors, cause);
this.cvsl = cvsList;
this.af = transformKeys(hashMap, TabletIdImpl.KE_2_TID_OLD);
this.es = serverSideErrors;
Expand All @@ -93,8 +101,8 @@ public MutationsRejectedException(List<ConstraintViolationSummary> cvsList, Hash
@Deprecated
public MutationsRejectedException(Instance instance, List<ConstraintViolationSummary> cvsList,
HashMap<org.apache.accumulo.core.data.KeyExtent,Set<SecurityErrorCode>> hashMap, Collection<String> serverSideErrors, int unknownErrors, Throwable cause) {
super("# constraint violations : " + cvsList.size() + " security codes: " + format(transformKeys(hashMap, TabletIdImpl.KE_2_TID_OLD), instance)
+ " # server errors " + serverSideErrors.size() + " # exceptions " + unknownErrors, cause);
super(CONSTRAINT_VIOLATIONS + cvsList.size() + SECURITY_CODES + format(transformKeys(hashMap, TabletIdImpl.KE_2_TID_OLD), instance)
+ SERVER_ERRORS + serverSideErrors.size() + EXCEPTIONS + unknownErrors, cause);
this.cvsl = cvsList;
this.af = transformKeys(hashMap, TabletIdImpl.KE_2_TID_OLD);
this.es = serverSideErrors;
Expand All @@ -116,8 +124,8 @@ public MutationsRejectedException(Instance instance, List<ConstraintViolationSum
*/
public MutationsRejectedException(Instance instance, List<ConstraintViolationSummary> cvsList, Map<TabletId,Set<SecurityErrorCode>> hashMap,
Collection<String> serverSideErrors, int unknownErrors, Throwable cause) {
super("# constraint violations : " + cvsList.size() + " security codes: " + format(hashMap, instance) + " # server errors " + serverSideErrors.size()
+ " # exceptions " + unknownErrors, cause);
super(CONSTRAINT_VIOLATIONS + cvsList.size() + SECURITY_CODES + format(hashMap, instance) + SERVER_ERRORS + serverSideErrors.size()
+ EXCEPTIONS + unknownErrors, cause);
this.cvsl = cvsList;
this.af = hashMap;
this.es = serverSideErrors;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public IteratorSetting getIteratorSetting(String namespace, String name, Iterato
String opt = root + ".opt.";
for (Entry<String,String> property : this.getProperties(namespace)) {
if (property.getKey().equals(root)) {
String parts[] = property.getValue().split(",");
String[] parts = property.getValue().split(",");
if (parts.length != 2) {
throw new AccumuloException("Bad value for iterator setting: " + property.getValue());
}
Expand Down Expand Up @@ -147,7 +147,7 @@ public void checkIteratorConflicts(String namespace, IteratorSetting setting, En
optionConflicts.put(property.getKey(), property.getValue());
if (property.getKey().contains(".opt."))
continue;
String parts[] = property.getValue().split(",");
String[] parts = property.getValue().split(",");
if (parts.length != 2)
throw new AccumuloException("Bad value for existing iterator setting: " + property.getKey() + "=" + property.getValue());
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1078,7 +1078,7 @@ public void importDirectory(String tableName, String dir, String failureDir, boo
Path failPath = checkPath(failureDir, "Bulk", "failure");

List<ByteBuffer> args = Arrays.asList(ByteBuffer.wrap(tableName.getBytes(UTF_8)), ByteBuffer.wrap(dirPath.toString().getBytes(UTF_8)),
ByteBuffer.wrap(failPath.toString().getBytes(UTF_8)), ByteBuffer.wrap((setTime + "").getBytes(UTF_8)));
ByteBuffer.wrap(failPath.toString().getBytes(UTF_8)), ByteBuffer.wrap((Boolean.toString(setTime)).getBytes(UTF_8)));
Map<String,String> opts = new HashMap<String,String>();

try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,8 @@ public void setFieldValue(_Fields field, Object value) {
}
break;

default:
break;
}
}

Expand All @@ -266,6 +268,8 @@ public Object getFieldValue(_Fields field) {
case CODE:
return getCode();

default:
break;
}
throw new IllegalStateException();
}
Expand All @@ -281,6 +285,8 @@ public boolean isSet(_Fields field) {
return isSetUser();
case CODE:
return isSetCode();
default:
break;
}
throw new IllegalStateException();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ public BlockReader get() throws IOException {

@Override
public String getInfo() {
return "" + blockIndex;
return Integer.toString(blockIndex);
}

}
Expand All @@ -194,7 +194,7 @@ public BlockReader get() throws IOException {

@Override
public String getInfo() {
return "" + offset + "," + compressedSize + "," + rawSize;
return offset + "," + compressedSize + "," + rawSize;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,7 @@ public static void setAuthorizations(IteratorSetting config, Authorizations auth
* size in bytes
*/
public static void setMaxBufferSize(IteratorSetting config, long maxBufferSize) {
config.addOption(MAX_BUFFER_SIZE_OPT, maxBufferSize + "");
config.addOption(MAX_BUFFER_SIZE_OPT, Long.toString(maxBufferSize));
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ public byte[] encode() {

public String encodeAsString() {
if (time >= 0)
return ("" + size + "," + numEntries + "," + time);
return ("" + size + "," + numEntries);
return (size + "," + numEntries + "," + time);
return (size + "," + numEntries);
}

public Value encodeAsValue() {
Expand Down