Diff
stringlengths
10
2k
Message
stringlengths
28
159
import org.apache.accumulo.core.client.security.SecurityErrorCode; import org.apache.accumulo.trace.instrument.Trace;
Do not forget to remove this deprecated code someday.
import org.apache.accumulo.core.client.impl.thrift.ThriftSecurityException;
Move this constructor to comply with Java Code Conventions.
import org.apache.hadoop.mapreduce.InputFormat; /** * This class allows MapReduce jobs to use Accumulo as the source of data. This {@link InputFormat} provides row names as {@link Text} as keys, and a * corresponding {@link PeekingIterator} as a value, which in turn makes the {@link Key}/{@link Value} pairs for that row available to the Map function. * * The user must specify the following via static configurator methods: * * <ul> * <li>{@link AccumuloRowInputFormat#setInputInfo(org.apache.hadoop.mapreduce.Job, String, byte[], String, org.apache.accumulo.core.security.Authorizations)} * <li>{@link AccumuloRowInputFormat#setZooKeeperInstance(org.apache.hadoop.mapreduce.Job, String, String)} * </ul> * * Other static methods are optional. */
Move this variable to comply with Java Code Conventions.
Trace.offNoFlush();
2 duplicated blocks of code must be removed.
package org.apache.accumulo.cloudtrace.instrument.receivers;
Rename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.
currentRow = new Text(); currentDocID.set(emptyByteArray); doSeek(range, seekColumnFamilies, inclusive); } private void doSeek(Range range, Collection<ByteSequence> seekColumnFamilies, boolean inclusive) throws IOException { log.debug("doSeek, topKey is outside of overall range: " + overallRange); return false; Range range = new Range(row); this.currentRow = row; this.currentDocID = new Text(this.getUID(jumpKey)); doSeek(range, seekColumnFamilies, false);
31 duplicated blocks of code must be removed.
bifCopyQueue.addWork(orig.getName(), (failure + "," + dest).getBytes());
Remove this unused method parameter "ex".
import org.apache.accumulo.core.cli.BatchWriterOpts; import org.apache.accumulo.core.cli.ClientOpts; import org.apache.accumulo.core.cli.ScannerOpts; ClientOpts opts = new ClientOpts(); ScannerOpts scanOpts = new ScannerOpts(); BatchWriterOpts bwOpts = new BatchWriterOpts(); opts.parseArgs(RowOperations.class.getName(), args, scanOpts, bwOpts); connector = opts.getConnector(); bw = connector.createBatchWriter(table, bwOpts.getBatchWriterConfig()); Scanner rowThree = getRow(opts, scanOpts, new Text("row3")); Scanner rowTwo = getRow(opts, scanOpts, new Text("row2")); Scanner rowOne = getRow(opts, scanOpts, new Text("row1")); rowTwo = getRow(opts, scanOpts, new Text("row2")); rowThree = getRow(opts, scanOpts, new Text("row3")); rowTwo = getRow(opts, scanOpts, new Text("row2")); rowOne = getRow(opts, scanOpts, new Text("row1")); deleteRow(opts, scanOpts, row1); rowThree = getRow(opts, scanOpts, new Text("row3")); rowTwo = getRow(opts, scanOpts, new Text("row2")); rowOne = getRow(opts, scanOpts, new Text("row1")); * @param opts private static void deleteRow(ClientOpts opts, ScannerOpts scanOpts, Text row) throws AccumuloException, AccumuloSecurityException, TableNotFoundException { deleteRow(getRow(opts, scanOpts, row)); * @param opts private static Scanner getRow(ClientOpts opts, ScannerOpts scanOpts, Text row) throws AccumuloException, AccumuloSecurityException, TableNotFoundException { scanner.setBatchSize(scanOpts.scanBatchSize);
Remove this unused private "appendProp" method.
package org.apache.accumulo.core.util.shell.commands; 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 NoTableCommand extends Command{ private Option tableOpt; @Override public int execute(String fullCommand, CommandLine cl, Shell shellState) throws Exception { shellState.setTableName(""); return 0; } @Override public String description() { return "returns to a tableless shell state"; } public String usage(){ return getName(); } @Override public int numArgs() { return 0; } public Options getOptions(){ Options o = new Options(); tableOpt = new Option (Shell.tableOption, "tableName", true , "Returns to a no table state"); o.addOption(tableOpt); return o; } }
Return empty string instead.
import org.apache.accumulo.core.security.thrift.Credential; MetadataTable.getEntries(conn.getInstance(), opts.getCredentials(), tableName, false, checkTabletServer(conf.getConfiguration(), opts.getCredentials(), entry, failures); private static void checkTabletServer(AccumuloConfiguration conf, Credential st, Entry<String,List<KeyExtent>> entry,
Rename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import org.apache.accumulo.core.metadata.MetadataTable; import org.apache.accumulo.core.metadata.schema.MetadataSchema; Map<String,String> siteConfig = new HashMap<String,String>(); siteConfig.put(Property.TSERV_MAJC_DELAY.getKey(), "1s"); @Test(timeout = 120 * 1000) UtilWaitThread.sleep(15 * 1000); MetadataSchema.TabletsSection.TabletColumnFamily.PREV_ROW_COLUMN.fetch(s); assertEquals(0, cluster.exec(CheckForMetadataProblems.class, "-i", cluster.getInstanceName(), "-u", "root", "-p", MacTest.PASSWORD, "-z", cluster.getZooKeepers()) .waitFor()); @Test(timeout = 60 * 1000) c.tableOperations().setProperty("test_ingest", Property.TABLE_FILE_COMPRESSION_TYPE.getKey(), "none"); UtilWaitThread.sleep(5 * 1000); assertTrue(c.tableOperations().listSplits("test_ingest").size() > 10); @Test(timeout = 120 * 1000)
Rename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.
package org.apache.accumulo.server.test.randomwalk.concurrent; import java.util.Properties; import org.apache.accumulo.server.test.randomwalk.State; import org.apache.accumulo.server.test.randomwalk.Test; public class StartAll extends Test { @Override public void visit(State state, Properties props) throws Exception { log.info("Starting all servers"); Runtime.getRuntime().exec(new String[]{System.getenv().get("ACCUMULO_HOME") + "/bin/start-all.sh"}); } }
Define and throw a dedicated exception instead of using a generic one.
@Test(timeout = 2 * 60 * 1000)
Either log or rethrow this exception.
@Override return tokenClass.equals(PasswordToken.class.getName());
Use "Integer.toString" instead.
import org.apache.accumulo.server.fs.VolumeManager; import org.apache.accumulo.server.fs.VolumeManagerImpl; VolumeManager fs = VolumeManagerImpl.getLocal();
Rename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.
setEncoder(type.substring(CLASS_PREFIX.length())); testEncoder(42l); setEncoder(VAR_LEN_ENCODER); setEncoder(FIXED_LEN_ENCODER); setEncoder(STRING_ENCODER);
Rename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.
import org.apache.accumulo.core.iterators.user.VersioningIterator;
Remove this unused private "match" method.
Map<FileRef,MapFileInfo> fileRefMap = new HashMap<FileRef,MapFileInfo>(); String tableToVerify = MetadataTable.ID; if (extent.isMeta()) tableToVerify = RootTable.ID; ScannerImpl scanner = new ScannerImpl(HdfsZooInstance.getInstance(), SecurityConstants.getSystemCredentials(), tableToVerify, Authorizations.EMPTY); public void recover(VolumeManager fs, Tablet tablet, List<LogEntry> logEntries, Set<String> tabletFiles, MutationReceiver mutationReceiver) throws IOException {
Reduce this switch case number of lines from 12 to at most 5, for example by extracting code into methods.
import org.apache.accumulo.core.util.interpret.ScanInterpreter; public int execute(String fullCommand, CommandLine cl, Shell shellState) throws Exception { ScanInterpreter interpeter = getInterpreter(cl, tableName, shellState); Range range = getRange(cl, interpeter);
Return empty string instead.
import org.apache.accumulo.core.security.thrift.SecurityErrorCode; import org.apache.accumulo.core.security.thrift.ThriftSecurityException; import org.apache.accumulo.core.security.tokens.PasswordToken;
1 duplicated blocks of code must be removed.
import org.apache.accumulo.trace.instrument.Tracer;
Remove the redundant '!unknownSymbol!' thrown exception declaration(s).
import org.apache.accumulo.examples.wikisearch.parser.RangeCalculator; return Collections.singletonList(new Range());
31 duplicated blocks of code must be removed.
/* * 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 * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING */ package org.apache.accumulo.proxy.thrift; import java.util.Map; import java.util.HashMap; import org.apache.thrift.TEnum; @SuppressWarnings("all") public enum CompactionType implements org.apache.thrift.TEnum { MINOR(0), MERGE(1), MAJOR(2), FULL(3); private final int value; private CompactionType(int value) { this.value = value; } /** * Get the integer value of this enum value, as defined in the Thrift IDL. */ public int getValue() { return value; } /** * Find a the enum type by its integer value, as defined in the Thrift IDL. * @return null if the value is not found. */ public static CompactionType findByValue(int value) { switch (value) { case 0: return MINOR; case 1: return MERGE; case 2: return MAJOR; case 3: return FULL; default: return null; } } }
Rename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.
import org.apache.accumulo.core.cli.ClientOnRequiredTable; import com.beust.jcommander.Parameter; static class Opts extends ClientOnRequiredTable { @Parameter(names="--input", description="input directory") String inputDirectory; public int run(String[] args) throws Exception { Opts opts = new Opts(); opts.parseArgs(WordCount.class.getName(), args); TextInputFormat.setInputPaths(job, new Path(opts.inputDirectory)); opts.setAccumuloConfigs(job);
Remove this unused private "appendProp" method.
import org.apache.accumulo.core.util.CachedConfiguration; import org.apache.accumulo.server.conf.TableConfiguration; final FileSystem fs = FileSystem.get(CachedConfiguration.getInstance()); final ServerConfiguration sconf = new ServerConfiguration(zki); return readFiles(fs, sconf.getConfiguration(), files, ke, columns); return readFilesUsingIterStack(fs, sconf, files, auths, ke, columns, false); return readFilesUsingIterStack(fs, sconf, files, auths, ke, columns, true); boolean useTableIterators, TableConfiguration conf) throws IOException { return IteratorUtil.loadIterators(IteratorScope.scan, visFilter, ke, conf, ssiList, ssio, null); private static int readFiles(FileSystem fs, AccumuloConfiguration aconf, List<String> files, KeyExtent ke, String[] columns) throws Exception { FileSKVIterator reader = FileOperations.getInstance().openReader(file, false, fs, fs.getConf(), aconf); private static int readFilesUsingIterStack(FileSystem fs, ServerConfiguration aconf, List<String> files, String auths[], KeyExtent ke, String[] columns, boolean useTableIterators) throws Exception { readers.add(FileOperations.getInstance().openReader(file, false, fs, fs.getConf(), aconf.getConfiguration())); TableConfiguration tconf = aconf.getTableConfiguration(ke.getTableId().toString()); reader = createScanIterator(ke, readers, new Authorizations(auths), new byte[] {}, new HashSet<Column>(), emptyIterinfo, emptySsio, useTableIterators, tconf);
Rename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.
/* * 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. */
Replace all tab characters in this file by sequences of white-spaces.
+ "Additional group options may be specified for a named group by setting table.group.&lt;name&gt;.opt.&lt;key&gt;=&lt;value&gt;."), TABLE_FORMATTER_CLASS("table.formatter", "org.apache.accumulo.core.util.format.DefaultFormatter", PropertyType.STRING, "The Formatter class to apply on results in the shell");
Remove this unused "tableFormatters" private field.
/* * 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. */
Replace all tab characters in this file by sequences of white-spaces.
if (diff > normalDelay * 2) gcStatus = "<span class='warning'>" + gcStatus + "</span>"; } else banner(sb, "error", "Master Server Not Running");
Remove this call to "exit" or ensure it is really required.
for(int group = 0; group < numGroups; group++) for(InputSplit split:superSplits) FileSplit fileSplit = (FileSplit)split;
Move this variable to comply with Java Code Conventions.
/* * 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. */
Replace all tab characters in this file by sequences of white-spaces.
@Override public org.apache.hadoop.util.bloom.Key transform(org.apache.accumulo.core.data.Key acuKey) { byte keyData[]; ByteSequence row = acuKey.getRowData(); ByteSequence cf = acuKey.getColumnFamilyData(); ByteSequence cq = acuKey.getColumnQualifierData(); keyData = new byte[row.length() + cf.length() + cq.length()]; System.arraycopy(row.getBackingArray(), row.offset(), keyData, 0, row.length()); System.arraycopy(cf.getBackingArray(), cf.offset(), keyData, row.length(), cf.length()); System.arraycopy(cq.getBackingArray(), cq.offset(), keyData, row.length() + cf.length(), cq.length()); return new org.apache.hadoop.util.bloom.Key(keyData, 1.0); } @Override public Key transform(Range range) { if (RowFunctor.isRangeInBloomFilter(range, PartialKey.ROW_COLFAM_COLQUAL)) { return transform(range.getStartKey()); return null; }
Rename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.
private class IdleFileCloser implements Runnable {
Return empty string instead.
* 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. */ public class AggregatorSet extends ColumnToClassMapping<Aggregator> { public AggregatorSet(Map<String,String> opts) throws InstantiationException, IllegalAccessException, ClassNotFoundException { super(opts, Aggregator.class); } public AggregatorSet() { super(); } public Aggregator getAggregator(Key k) { return getObject(k); }
Rename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.
connector = getInstance().getConnector(getCredentials()); return CredentialHelper.createSquelchError(username, new PasswordToken().setPassword(password.getBytes()), getInstance().getInstanceID()); String instance = props.getProperty("INSTANCE"); String zookeepers = props.getProperty("ZOOKEEPERS"); this.instance = new ZooKeeperInstance(instance, zookeepers);
Rename "instance" which hides the field declared at line 48.
/** * 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. */ package org.apache.accumulo.core.util.interpret; import org.apache.hadoop.io.Text; /** * */ public class DefaultScanInterpreter implements ScanInterpreter { @Override public Text interpretRow(Text row) { return row; } @Override public Text interpretBeginRow(Text row) { return row; } @Override public Text interpretEndRow(Text row) { return row; } @Override public Text interpretColumnFamily(Text cf) { return cf; } @Override public Text interpretColumnQualifier(Text cq) { return cq; } }
Return empty string instead.
/** * @deprecated since 1.4 * @use org.apache.accumulo.core.iterators.user.RegExFilter **/
Remove this unused private "match" method.
public static final String scan = "scan"; public static final String resultSize = "result"; public long getScanCount(); public long getScanAvgTime(); public long getScanMinTime(); public long getScanMaxTime(); public long getResultCount(); public long getResultAvgSize(); public long getResultMinSize(); public long getResultMaxSize(); public void reset();
Rename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.
/** * Subclasses must implement a typedReduce method: public V typedReduce(Key key, Iterator<V> iter); * /** /** * @param iter * The source iterator * @param encoder * The Encoder whose decode method is used to translate from Value to V /** /** * @param key * The most recent version of the Key being reduced. * @param iter * An iterator over the V for different versions of the key.
Remove the literal "true" boolean value.
return Long.toString(Ingest.encoder.decode(colf.getBytes())) + ":";
Either log or rethrow this exception.
/* * 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. */
296 duplicated blocks of code must be removed.
public void close() throws InterruptedException { getZooKeeper().close(); }
Move this variable to comply with Java Code Conventions.
import java.util.Set;
2 duplicated blocks of code must be removed.
List<ByteBuffer> args = Arrays.asList(ByteBuffer.wrap(tableName.getBytes()), ByteBuffer.wrap(timeType.name().getBytes())); List<ByteBuffer> args = Arrays.asList(ByteBuffer.wrap(tableName.getBytes()), start == null ? EMPTY : TextUtil.getByteBuffer(start), end == null ? EMPTY List<ByteBuffer> args = Arrays.asList(ByteBuffer.wrap(tableName.getBytes()), start == null ? EMPTY : TextUtil.getByteBuffer(start), end == null ? EMPTY List<ByteBuffer> args = Arrays.asList(ByteBuffer.wrap(tableName.getBytes())); List<ByteBuffer> args = Arrays.asList(ByteBuffer.wrap(srcTableId.getBytes()), ByteBuffer.wrap(newTableName.getBytes())); List<ByteBuffer> args = Arrays.asList(ByteBuffer.wrap(oldTableName.getBytes()), ByteBuffer.wrap(newTableName.getBytes())); List<ByteBuffer> args = Arrays.asList(ByteBuffer.wrap(tableId.getBytes()), start == null ? EMPTY : TextUtil.getByteBuffer(start), end == null ? EMPTY List<ByteBuffer> args = Arrays.asList(ByteBuffer.wrap(tableName.getBytes()), ByteBuffer.wrap(dir.getBytes()), ByteBuffer.wrap(failureDir.getBytes()), ByteBuffer.wrap((setTime + "").getBytes())); List<ByteBuffer> args = Arrays.asList(ByteBuffer.wrap(tableName.getBytes())); List<ByteBuffer> args = Arrays.asList(ByteBuffer.wrap(tableName.getBytes())); List<ByteBuffer> args = Arrays.asList(ByteBuffer.wrap(tableName.getBytes()), ByteBuffer.wrap(importDir.getBytes())); List<ByteBuffer> args = Arrays.asList(ByteBuffer.wrap(tableName.getBytes()), ByteBuffer.wrap(exportDir.getBytes()));
Remove this unused method parameter "ex".
synchronized public void init(SortedKeyValueIterator<Key,Value> source, Map<String,String> options, IteratorEnvironment env) throws IOException {
Remove the declaration of thrown exception 'java.io.IOException', as it cannot be thrown from method's body.
BYTE(1l,""), KILOBYTE(1024l,"K"), MEGABYTE(1024 * 1024l,"M"), GIGABYTE(1024 * 1024 * 1024l,"G"); private final String suffix; private MemoryUnit(long multiplier, String suffix) { this.suffix = suffix; public String suffix() { return suffix; } public static MemoryUnit fromSuffix(String suffix) { for(MemoryUnit memoryUnit : MemoryUnit.values()) { if(memoryUnit.suffix .equals(suffix)) return memoryUnit; } return null; }
Rename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.
final int dfaultPort = ServerConfiguration.getDefaultConfiguration().getPort(portDefaultProperty);
Rename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.
/* * 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. */
Replace all tab characters in this file by sequences of white-spaces.
import org.apache.accumulo.core.client.BatchWriterConfig; BatchWriter bw = getConnector().createBatchWriter("tt", new BatchWriterConfig());
Remove this unused method parameter "e".
import org.apache.accumulo.core.client.security.tokens.PasswordToken;
Move this constructor to comply with Java Code Conventions.
import org.apache.accumulo.fate.zookeeper.ZooReader; DistributedTrace.enable(instance, new ZooReader(instance.getZooKeepers(), instance.getZooKeepersSessionTimeOut()), name, null);
Remove this call to "exit" or ensure it is really required.
} else if (exists = ZooReaderWriter.getInstance().exists(instanceNamePath)) { rootpass = getConsoleReader() .readLine("Enter initial password for " + DEFAULT_ROOT_USER + " (this may not be applicable for your security setup): ", '*'); "Your HDFS replication " + reason + " is not compatible with our default " + Constants.METADATA_TABLE_NAME + " replication of 5. What do you want to set your " + Constants.METADATA_TABLE_NAME + " replication to? (" + replication + ") ");
Immediately return this expression instead of assigning it to the temporary variable "client".
/* * 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. */
Replace all tab characters in this file by sequences of white-spaces.
public static void addNewTablet(KeyExtent extent, String path, TServerInstance location, Map<String,DataFileValue> datafileSizes, Map<String,Long> bulkLoadedFiles, AuthInfo credentials, String time, long lastFlushID, long lastCompactID, ZooLock zooLock) { for (Entry<String,Long> entry : bulkLoadedFiles.entrySet()) { byte[] tidBytes = Long.toString(entry.getValue()).getBytes(); m.put(Constants.METADATA_BULKFILE_COLUMN_FAMILY, new Text(entry.getKey()), new Value(tidBytes)); } Map<String,Long> bulkFiles = getBulkFilesLoaded(credentials, metadataEntry); MetadataTable.addNewTablet(low, lowDirectory, tserver, lowDatafileSizes, bulkFiles, credentials, time, initFlushID, initCompactID, lock); public static Map<String,Long> getBulkFilesLoaded(AuthInfo credentials, KeyExtent extent) { return getBulkFilesLoaded(credentials, extent.getMetadataEntry()); } public static Map<String,Long> getBulkFilesLoaded(AuthInfo credentials, Text metadataRow) { Map<String,Long> ret = new HashMap<String,Long>(); Scanner scanner = new ScannerImpl(HdfsZooInstance.getInstance(), credentials, Constants.METADATA_TABLE_ID, Constants.NO_AUTHS); scanner.setRange(new Range(metadataRow)); scanner.fetchColumnFamily(Constants.METADATA_BULKFILE_COLUMN_FAMILY); for (Entry<Key,Value> entry : scanner) { String file = entry.getKey().getColumnQualifier().toString(); Long tid = Long.parseLong(entry.getValue().toString()); ret.put(file, tid); } return ret; }
Either log or rethrow this exception.
package org.apache.accumulo.test.randomwalk.shard; import org.apache.accumulo.test.randomwalk.State; import org.apache.accumulo.test.randomwalk.Test;
Move the "org.apache.accumulo.test.randomwalk.unit.CreateTable" string literal on the left side of this string comparison.
@SuppressWarnings("unchecked") public static <T> T service(final T instance) { InvocationHandler handler = new InvocationHandler() { @Override public Object invoke(Object obj, Method method, Object[] args) throws Throwable { if (args == null || args.length < 1 || args[0] == null || !(args[0] instanceof TInfo)) { return method.invoke(instance, args); } Span span = Trace.trace((TInfo) args[0], method.getName()); try { return method.invoke(instance, args); } catch (InvocationTargetException ex) { throw ex.getCause(); } finally { span.stop(); } } }; return (T) Proxy.newProxyInstance(instance.getClass().getClassLoader(), instance.getClass().getInterfaces(), handler); } @SuppressWarnings("unchecked") public static <T> T client(final T instance) { InvocationHandler handler = new InvocationHandler() { @Override public Object invoke(Object obj, Method method, Object[] args) throws Throwable { if (args == null || args.length < 1 || args[0] != null) { return method.invoke(instance, args); } Class<?> klass = method.getParameterTypes()[0]; if (TInfo.class.isAssignableFrom(klass)) { args[0] = Tracer.traceInfo(); } Span span = Trace.start("client:" + method.getName()); try { return method.invoke(instance, args); } catch (InvocationTargetException ex) { throw ex.getCause(); } finally { span.stop(); } } }; return (T) Proxy.newProxyInstance(instance.getClass().getClassLoader(), instance.getClass().getInterfaces(), handler); }
Rename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.
* 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. */ public class CopyTool extends Configured implements Tool { protected final Logger log = Logger.getLogger(this.getClass()); public static class SeqMapClass extends Mapper<Key,Value,Text,Mutation> { public void map(Key key, Value val, Context output) throws IOException, InterruptedException { Mutation m = new Mutation(key.getRow()); m.put(key.getColumnFamily(), key.getColumnQualifier(), val); output.write(null, m); public int run(String[] args) throws Exception { log.error("M/R requires a jar file! Run mvn package."); return 1;
Rename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.
private Map<String,TabletLocator> locators; locators = new HashMap<String,TabletLocator>(); private TabletLocator getLocator(String tableId) { TabletLocator ret = locators.get(tableId); if (ret == null) { ret = TabletLocator.getInstance(instance, credentials, new Text(tableId)); ret = new TimeoutTabletLocator(ret, timeout); locators.put(tableId, ret); } return ret; } TabletLocator locator = getLocator(entry.getKey());
Move this constructor to comply with Java Code Conventions.
return getInstance(instanceId, false); public static synchronized SecurityOperation getInstance(String instanceId, boolean initialize) { instance = new SecurityOperation(getAuthorizor(instanceId, initialize), getAuthenticator(instanceId, initialize), getPermHandler(instanceId, initialize), instanceId); protected static Authorizor getAuthorizor(String instanceId, boolean initialize) { toRet.initialize(instanceId, initialize); protected static Authenticator getAuthenticator(String instanceId, boolean initialize) { toRet.initialize(instanceId, initialize); protected static PermissionHandler getPermHandler(String instanceId, boolean initialize) { toRet.initialize(instanceId, initialize); if (SecurityConstants.getSystemCredentials().equals(credentials)) return; else if (credentials.getPrincipal().equals(SecurityConstants.SYSTEM_USERNAME)) { throw new ThriftSecurityException(credentials.getPrincipal(), SecurityErrorCode.BAD_CREDENTIALS); log.debug(e); // User is already authenticated from canAskAboutUser, this gets around issues with !SYSTEM user if (credentials.getToken().equals(token)) return true; } try { if (!authenticator.userExists(user)) throw new ThriftSecurityException(user, SecurityErrorCode.USER_DOESNT_EXIST); } catch (AccumuloSecurityException e) { throw e.asThriftException(); }
Remove this call to "exit" or ensure it is really required.
if (p.getDefaultValue().equals(entry.value)) continue; if (value % 1000 == 0) entry.value = String.format("%ds", value / 1000); else entry.value = String.format("%.2fs", value / 1000.); if (entry.property.equals("table.scan.max.time")) entry.value = entry.value + "ms"; if (entry.description.trim().length() > 0) out.println(" <description>" + entry.description + "</description>");
Remove this call to "exit" or ensure it is really required.
package org.apache.accumulo.server.test.randomwalk.bulk; import java.util.Properties; import org.apache.accumulo.server.test.randomwalk.State; import org.apache.accumulo.server.test.randomwalk.Test; public abstract class BulkTest extends Test { @Override public void visit(final State state, Properties props) throws Exception { Setup.run(state, new Runnable() { @Override public void run() { try { runLater(state); } catch (Throwable ex) { log.error(ex, ex); } } }); } abstract protected void runLater(State state) throws Exception; }
Return empty string instead.
import org.apache.accumulo.core.conf.AccumuloConfiguration; public RemoteLogger(String address, UUID tserverUUID, AccumuloConfiguration conf) throws ThriftSecurityException, LoggerClosedException, TException, IOException { client = ThriftUtil.getClient(new MutationLogger.Client.Factory(), address, Property.LOGGER_PORT, Property.TSERV_LOGGER_TIMEOUT, conf); public RemoteLogger(String address, AccumuloConfiguration conf) throws IOException { client = ThriftUtil.getClient(new MutationLogger.Client.Factory(), address, Property.LOGGER_PORT, Property.TSERV_LOGGER_TIMEOUT, conf); public synchronized long startCopy(String name, String fullyQualifiedFileName) throws ThriftSecurityException, TException { return client.startCopy(null, SecurityConstants.getSystemCredentials(), name, fullyQualifiedFileName, true);
Rename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.
if (a == null && b == null) return 0; if (a == null) return -1; if (b == null) return 1; if (result != 0) return result; if (result != 0) return result; if (that == null) return false; if (that instanceof Column) return this.equals((Column) that); if (b == null) return 0;
Remove this call to "exit" or ensure it is really required.
import org.apache.accumulo.core.security.thrift.ThriftSecurityException;
1 duplicated blocks of code must be removed.
import org.apache.accumulo.core.security.thrift.Credential; public void send(Credential auth, String serverName, Iface client) throws TException, ThriftSecurityException {
Rename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.
import org.apache.accumulo.core.security.thrift.Credential; public void initializeSecurity(Credential token, String rootuser) throws AccumuloSecurityException {
Rename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.
package org.apache.accumulo.test.randomwalk.multitable; import org.apache.accumulo.test.randomwalk.State; import org.apache.accumulo.test.randomwalk.Test;
Move the "org.apache.accumulo.test.randomwalk.unit.CreateTable" string literal on the left side of this string comparison.
import org.apache.accumulo.core.client.impl.thrift.TableOperationExceptionType; import org.apache.accumulo.core.client.impl.thrift.ThriftTableOperationException; logger.debug(e, e); return new org.apache.accumulo.proxy.thrift.MutationsRejectedException(e.toString()); if (e.getCause() instanceof ThriftTableOperationException) { ThriftTableOperationException ttoe = (ThriftTableOperationException) e.getCause(); if (ttoe.type == TableOperationExceptionType.NOTFOUND) { return new org.apache.accumulo.proxy.thrift.TableNotFoundException(e.toString()); } } logger.debug(e, e); logger.debug(e, e); logger.debug(e, e); logger.debug(e, e); public boolean authenticateUser(ByteBuffer login, String principal, Map<String,String> properties) throws TException { private AuthenticationToken getToken(String principal, Map<String,String> properties) throws AccumuloSecurityException, AccumuloException {
Either log or rethrow this exception.
import java.nio.charset.Charset; private static final Charset utf8 = Charset.forName("UTF8"); this.value = new Value(Integer.toString(count).getBytes(utf8));
Move this variable to comply with Java Code Conventions.
public AuthenticationToken login(String principal, Properties properties) throws AccumuloSecurityException { throw new AccumuloSecurityException(principal, SecurityErrorCode.INSUFFICIENT_PROPERTIES);
Remove this unused method parameter "principal".
package org.apache.accumulo.server.test.functional; import org.apache.accumulo.core.data.Key; import org.apache.accumulo.core.data.Value; import org.apache.accumulo.core.iterators.IteratorEnvironment; import org.apache.accumulo.core.iterators.SortedKeyValueIterator; import org.apache.accumulo.core.iterators.WrappingIterator; public class BadIterator extends WrappingIterator { @Override public Key getTopKey() { throw new NullPointerException(); } @Override public SortedKeyValueIterator<Key, Value> deepCopy(IteratorEnvironment env) { throw new UnsupportedOperationException(); } }
Return empty string instead.
String baseDir = ServerConstants.getBaseDirs()[0];
Rename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.
import org.apache.accumulo.core.Constants; private long readaheadThreshold; scanner.setReadaheadThreshold(readaheadThreshold); public RowBufferingIterator(Scanner scanner, ScannerOptions opts, Range range, long timeout, int batchSize, long readaheadThreshold, RowBufferFactory bufferFactory) { this.readaheadThreshold = readaheadThreshold; private long readaheadThreshold; this.readaheadThreshold = scanner.getReadaheadThreshold(); return new RowBufferingIterator(scanner, this, range, timeOut, batchSize, readaheadThreshold, bufferFactory); @Override public long getReadaheadThreshold() { return readaheadThreshold; } @Override public void setReadaheadThreshold(long batches) { if (0 > batches) { throw new IllegalArgumentException("Number of batches before read-ahead must be non-negative"); } this.readaheadThreshold = batches; }
Move this constructor to comply with Java Code Conventions.
if (userExists(user)) { byte[] authsBytes = zooCache.get(ZKUserPath + "/" + user + ZKUserAuths); if (authsBytes != null) return Tool.convertAuthorizations(authsBytes); } return Tool.convertTablePermissions(serializedPerms).contains(permission); byte[] permBytes = zooCache.get(ZKUserPath + "/" + user + ZKUserSysPerms); if (permBytes == null) { throw new AccumuloSecurityException(credentials.user, SecurityErrorCode.USER_DOESNT_EXIST); // user doesn't exist } Set<SystemPermission> perms = Tool.convertSystemPermissions(permBytes); } else throw new AccumuloSecurityException(credentials.user, SecurityErrorCode.USER_DOESNT_EXIST); // user doesn't exist byte[] sysPermBytes = zooCache.get(ZKUserPath + "/" + user + ZKUserSysPerms); if (sysPermBytes == null) throw new AccumuloSecurityException(credentials.user, SecurityErrorCode.USER_DOESNT_EXIST); Set<SystemPermission> sysPerms = Tool.convertSystemPermissions(sysPermBytes);
Rename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.
import java.util.Map.Entry; import org.apache.accumulo.core.Constants; @SuppressWarnings("deprecation") String newMapFile = String.format("%s/" + Constants.MAPFILE_EXTENSION + "_%04d", newDir, count++);
6 duplicated blocks of code must be removed.
/* * 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. */
Replace all tab characters in this file by sequences of white-spaces.
SummingCombiner.setCombineAllColumns(is, true); BulkPlusOne.counter.set(0l);
Either log or rethrow this exception.
import org.apache.accumulo.core.security.Credentials; Connector conn = new MockConnector(new Credentials(principal, token), acu, this);
Either log or rethrow this exception.
if (o instanceof CVSKey) return equals((CVSKey) o);
Remove this call to "exit" or ensure it is really required.
if (big < base) return df_mantissa.format(big) + SUFFIXES[0];
At most one statement is allowed per line, but 2 statements were found on this line.
/* * 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. */
296 duplicated blocks of code must be removed.
/* * 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. */
Replace all tab characters in this file by sequences of white-spaces.
* @see java.lang.Object#hashCode() */ @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((iteratorClass == null) ? 0 : iteratorClass.hashCode()); result = prime * result + ((name == null) ? 0 : name.hashCode()); result = prime * result + priority; result = prime * result + ((properties == null) ? 0 : properties.hashCode()); return result; } /** * @see java.lang.Object#equals() */ @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (!(obj instanceof IteratorSetting)) return false; IteratorSetting other = (IteratorSetting) obj; if (iteratorClass == null) { if (other.iteratorClass != null) return false; } else if (!iteratorClass.equals(other.iteratorClass)) return false; if (name == null) { if (other.name != null) return false; } else if (!name.equals(other.name)) return false; if (priority != other.priority) return false; if (properties == null) { if (other.properties != null) return false; } else if (!properties.equals(other.properties)) return false; return true; } /**
Either log or rethrow this exception.
/* * 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. */
Replace all tab characters in this file by sequences of white-spaces.
package org.apache.accumulo.test.functional;
Move the "org.apache.accumulo.test.randomwalk.unit.CreateTable" string literal on the left side of this string comparison.
int counts[] = new int[TabletState.values().length]; public int unassigned() { return counts[TabletState.UNASSIGNED.ordinal()]; } public int assigned() { return counts[TabletState.ASSIGNED.ordinal()]; } public int assignedToDeadServers() { return counts[TabletState.ASSIGNED_TO_DEAD_SERVER.ordinal()]; } public int hosted() { return counts[TabletState.HOSTED.ordinal()]; }
Rename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.
import java.util.Map.Entry; import org.apache.accumulo.core.client.Instance; import org.apache.accumulo.core.util.CachedConfiguration; import org.apache.accumulo.server.conf.ServerConfiguration; import org.apache.hadoop.fs.FileSystem; public static void checkMetadataTableEntries(ServerConfiguration conf, FileSystem fs, boolean offline, boolean patch) throws Exception { scanner = new OfflineMetadataScanner(conf.getConfiguration(), fs); scanner = new ScannerImpl(conf.getInstance(), new AuthInfo(user, ByteBuffer.wrap(pass), conf.getInstance().getInstanceID()), FileSystem fs = FileSystem.get(CachedConfiguration.getInstance()); Instance instance = HdfsZooInstance.getInstance(); ServerConfiguration conf = new ServerConfiguration(instance); checkMetadataTableEntries(conf, fs, offline, fix); checkMetadataTableEntries(conf, fs, offline, fix);
Rename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.
@Override public String usage() { return getName() + " <seconds>"; }
Reduce this switch case number of lines from 8 to at most 5, for example by extracting code into methods.
KeyExtent root = RootTable.EXTENT;
Reduce this switch case number of lines from 12 to at most 5, for example by extracting code into methods.
package org.apache.accumulo.cloudtrace.instrument; import org.apache.accumulo.cloudtrace.instrument.impl.NullSpan; import org.apache.accumulo.cloudtrace.instrument.impl.RootMilliSpan; import org.apache.accumulo.cloudtrace.instrument.receivers.SpanReceiver; import org.apache.accumulo.cloudtrace.thrift.TInfo;
Rename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.
@Deprecated
Return empty string instead.
public int execute(final String fullCommand, final CommandLine cl, final Shell shellState) throws IOException {
Remove the redundant '!unknownSymbol!' thrown exception declaration(s).
ROW(1), ROW_COLFAM(2), ROW_COLFAM_COLQUAL(3), ROW_COLFAM_COLQUAL_COLVIS(4), ROW_COLFAM_COLQUAL_COLVIS_TIME(5), //everything with delete flag ROW_COLFAM_COLQUAL_COLVIS_TIME_DEL(6)
Return empty string instead.
checkBalance(metadataTable, servers, null); if (expectedCounts != null) { for (FakeTServer server : servers.values()) { Map<String,Integer> counts = new HashMap<String,Integer>(); for (KeyExtent extent : server.extents) { String t = extent.getTableId().toString(); if (counts.get(t) == null) counts.put(t, 0); counts.put(t, counts.get(t) + 1); } for (Entry<String,Integer> entry : counts.entrySet()) { assertEquals(expectedCounts.get(entry.getKey()), counts.get(entry.getKey())); }
Rename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.
/* * 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. */
Replace all tab characters in this file by sequences of white-spaces.
@Override public IteratorOptions describeOptions() { IteratorOptions io = super.describeOptions(); io.setName("min"); io.setDescription("MinCombiner interprets Values as Longs and finds their minimum. A variety of encodings (variable length, fixed length, or string) are available"); return io; }
Move this variable to comply with Java Code Conventions.
public static String getTableOpt(final CommandLine cl, final Shell shellState) throws TableNotFoundException { if (!shellState.getConnector().tableOperations().exists(tableName)) { } public static Option tableOpt(final String description) { final Option tableOpt = new Option(Shell.tableOption, "table", true, description); public static AdlOpt getAldOpt(final CommandLine cl) { public static OptionGroup addListDeleteGroup(final String name) { final Option addOpt = new Option(AdlOpt.ADD.opt, "add", false, "add " + name); final Option deleteOpt = new Option(AdlOpt.DELETE.opt, "delete", false, "delete " + name); final Option listOpt = new Option(AdlOpt.LIST.opt, "list", false, "list " + name + "(s)"); final OptionGroup og = new OptionGroup(); final Option o = new Option(START_ROW_OPT, "begin-row", true, "begin row (inclusive)"); final Option o = new Option(END_ROW_OPT, "end-row", true, "end row (inclusive)"); public static Text getStartRow(final CommandLine cl) throws UnsupportedEncodingException { if (cl.hasOption(START_ROW_OPT)) { } else { } public static Text getEndRow(final CommandLine cl) throws UnsupportedEncodingException { if (cl.hasOption(END_ROW_OPT)) { } else { }
Remove the redundant '!unknownSymbol!' thrown exception declaration(s).
import java.util.concurrent.TimeUnit; protected long timeOut = Long.MAX_VALUE; public void setTimeout(long timeout, TimeUnit timeUnit) { if (timeout == 0) this.timeOut = Long.MAX_VALUE; else this.timeOut = timeUnit.toMillis(timeout); public long getTimeout(TimeUnit timeunit) {
Move this constructor to comply with Java Code Conventions.
int lastSize = 0; int size = threadPool.getQueue().size() + threadPool.getActiveCount(); log.info("Waiting for " + size + " nodes to complete"); if (size != lastSize) makingProgress(); lastSize = size;
Rename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.
* @see RowFilter
Complete the task associated to this TODO comment.