Diff stringlengths 10 2k | Message stringlengths 28 159 |
|---|---|
import org.apache.accumulo.core.cli.ScannerOpts;
ScannerOpts scanOpts = new ScannerOpts();
opts.parseArgs(TraceDump.class.getName(), args, scanOpts);
code = listSpans(opts, scanOpts);
code = dumpTrace(opts, scanOpts);
private static int listSpans(Opts opts, ScannerOpts scanOpts) throws Exception {
scanner.setBatchSize(scanOpts.scanBatchSize);
private static int dumpTrace(Opts opts, ScannerOpts scanOpts) throws Exception {
scanner.setBatchSize(scanOpts.scanBatchSize); | Remove this unused method parameter "opts". |
import org.apache.accumulo.core.client.BatchWriterConfig;
writer = conn.createBatchWriter("test", new BatchWriterConfig()); | Remove this unused method parameter "e". |
* Holds configuration for {@link MiniAccumuloCluster}. Required configurations must be passed to constructor(s) and all other configurations are optional.
// Sanity checks
String[] paths = {"$ACCUMULO_HOME/lib/.*.jar", "$ZOOKEEPER_HOME/zookeeper[^.].*.jar", "$HADOOP_PREFIX/[^.].*.jar", "$HADOOP_PREFIX/lib/[^.].*.jar",
"$HADOOP_PREFIX/share/hadoop/common/.*.jar", "$HADOOP_PREFIX/share/hadoop/common/lib/.*.jar", "$HADOOP_PREFIX/share/hadoop/hdfs/.*.jar",
"$HADOOP_PREFIX/share/hadoop/mapreduce/.*.jar"}; | Immediately return this expression instead of assigning it to the temporary variable "onlineTabletsForTable". |
import java.util.List;
public void compact(String tableName, Text start, Text end, List<IteratorSetting> iterators, boolean flush, boolean wait) throws AccumuloSecurityException,
TableNotFoundException, AccumuloException {}
@Override | Use "Long.toString" instead. |
import org.apache.accumulo.core.client.BatchWriterConfig;
final MultiTableBatchWriter writer = connector.createMultiTableBatchWriter(new BatchWriterConfig()); | Remove this unused method parameter "e". |
import java.util.List;
import java.util.TimerTask;
import org.apache.accumulo.core.util.Pair;
import org.apache.accumulo.server.util.time.SimpleTimer;
final AccumuloConfiguration acuConf = conf.getConfiguration();
// do this last since "this" is leaking out to call back code below
SimpleTimer.getInstance().schedule(new TimerTask() {
@Override
public void run() {
// periodically reset the configurable thread pool sizes
List<Pair<ExecutorService, Property>> services = new ArrayList<Pair<ExecutorService, Property>>();
services.add(new Pair<ExecutorService,Property>(minorCompactionThreadPool, Property.TSERV_MINC_MAXCONCURRENT));
services.add(new Pair<ExecutorService,Property>(majorCompactionThreadPool, Property.TSERV_MAJC_MAXCONCURRENT));
services.add(new Pair<ExecutorService,Property>(migrationPool, Property.TSERV_MIGRATE_MAXCONCURRENT));
services.add(new Pair<ExecutorService,Property>(readAheadThreadPool, Property.TSERV_READ_AHEAD_MAXCONCURRENT));
services.add(new Pair<ExecutorService,Property>(defaultReadAheadThreadPool, Property.TSERV_METADATA_READ_AHEAD_MAXCONCURRENT));
for (Pair<ExecutorService,Property> pair : services) {
int count = acuConf.getCount(pair.getSecond());
ThreadPoolExecutor tp = (ThreadPoolExecutor) pair.getFirst();
if (tp.getMaximumPoolSize() != count) {
tp.setMaximumPoolSize(count);
}
}
}
}, 1000, 10 * 1000);
| Reduce this anonymous class number of lines from 22 to at most 20, or make it a named class. |
if (total == 0) {
log.trace("failed to see any tablets for this range, ignoring " + info.getRange());
return state;
} | Extract the assignment out of this expression. |
run(la.getInstanceName(), la.getZooKeepers(), "pass1234", args); | Define a constant instead of duplicating this literal "digest" 13 times. |
import org.apache.accumulo.core.tabletserver.TabletMutations;
copy.add(new TabletMutations(cs.getLogId(), cs.getWALogSeq(), entry.getValue())); | Remove this unused method parameter "timestamp". |
getConnector().tableOperations().addSplits("test_ingest", TestIngest.getSplitPoints(0, 100000, 50));
List<Text> splits = new ArrayList<Text>(TestIngest.getSplitPoints(0, 100000, 67)); | Remove this call to "exit" or ensure it is really required. |
package org.apache.accumulo.examples.wikisearch.logic;
import org.apache.accumulo.examples.wikisearch.ingest.WikipediaMapper;
import org.apache.accumulo.examples.wikisearch.iterator.BooleanLogicIterator;
import org.apache.accumulo.examples.wikisearch.iterator.EvaluatingIterator;
import org.apache.accumulo.examples.wikisearch.iterator.OptimizedQueryIterator;
import org.apache.accumulo.examples.wikisearch.iterator.ReadAheadIterator;
import org.apache.accumulo.examples.wikisearch.normalizer.LcNoDiacriticsNormalizer;
import org.apache.accumulo.examples.wikisearch.normalizer.Normalizer;
import org.apache.accumulo.examples.wikisearch.parser.EventFields;
import org.apache.accumulo.examples.wikisearch.parser.FieldIndexQueryReWriter;
import org.apache.accumulo.examples.wikisearch.parser.JexlOperatorConstants;
import org.apache.accumulo.examples.wikisearch.parser.QueryParser;
import org.apache.accumulo.examples.wikisearch.parser.RangeCalculator;
import org.apache.accumulo.examples.wikisearch.parser.EventFields.FieldValue;
import org.apache.accumulo.examples.wikisearch.parser.QueryParser.QueryTerm;
import org.apache.accumulo.examples.wikisearch.sample.Document;
import org.apache.accumulo.examples.wikisearch.sample.Field;
import org.apache.accumulo.examples.wikisearch.sample.Results; | Rename "table" which hides the field declared at line 107. |
String tableId = Tables.getNameToIdMap(instance).get(tableName);
Tables.clearCache(instance);
tableId = Tables.getNameToIdMap(instance).get(tableName);
return instance.getInstanceID();
return instance.getRootTabletLocation();
@Override | 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.
*/ | Replace all tab characters in this file by sequences of white-spaces. |
* @deprecated since 1.4, replaced by {@link org.apache.accumulo.core.iterators.user.MaxCombiner} with
* {@link org.apache.accumulo.core.iterators.LongCombiner.Type#STRING} | Either log or rethrow this exception. |
if (future != null)
futureSession = parse(future);
if (last != null)
lastSession = parse(last);
if (assignments.size() != 1)
throw new IllegalArgumentException("There is only one root tablet");
if (assignment.tablet.compareTo(Constants.ROOT_TABLET_EXTENT) != 0)
throw new IllegalArgumentException("You can only store the root tablet location");
if (assignments.size() != 1)
throw new IllegalArgumentException("There is only one root tablet");
if (assignment.tablet.compareTo(Constants.ROOT_TABLET_EXTENT) != 0)
throw new IllegalArgumentException("You can only store the root tablet location");
if (tablets.size() != 1)
throw new IllegalArgumentException("There is only one root tablet");
if (tls.extent.compareTo(Constants.ROOT_TABLET_EXTENT) != 0)
throw new IllegalArgumentException("You can only store the root tablet location"); | Remove this call to "exit" or ensure it is really required. |
public UserPassToken getAccumuloToken() {
return new UserPassToken(user, password.value);
return new UserPassToken(user, securePassword.value);
@Override
return getInstance().getConnector(this.getAccumuloToken());
AccumuloInputFormat.setZooKeeperInstance(job, instance, zookeepers);
AccumuloOutputFormat.setZooKeeperInstance(job, instance, zookeepers); | Return empty string instead. |
break; | Make the "log" logger private static final and rename it to comply with the format "LOG(?:GER)?". |
import org.apache.accumulo.server.master.Master;
public long close(Master m, FileSystem fs, Path path) throws IOException { | 1 duplicated blocks of code must be removed. |
import org.apache.accumulo.core.cli.ClientOnRequiredTable;
import com.beust.jcommander.Parameter;
private static class Opts extends ClientOnRequiredTable {
@Parameter(names="--column", required=true)
String column = null;
}
Opts opts = new Opts();
opts.parseArgs(RowHash.class.getName(), args);
opts.setAccumuloConfigs(job);
String col = opts.column; | Remove this unused private "appendProp" method. |
/*
* 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.test.functional;
import static org.junit.Assert.assertEquals;
import org.junit.Test;
public class SplitRecoveryIT extends MacTest {
@Test(timeout=10*1000)
public void test() throws Exception {
assertEquals(0, cluster.exec(SplitRecoveryTest.class).waitFor());
}
} | Rename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'. |
import org.apache.accumulo.core.security.thrift.TCredentials;
private static TCredentials credentials; | Rename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'. |
@Parameter(description = "<txid>", required = true)
@Parameters(commandDescription = "Stop an existing FATE by transaction id")
static class FailOpts extends TxOpts {}
@Parameters(commandDescription = "Delete an existing FATE by transaction id")
static class DeleteOpts extends TxOpts {}
@Parameters(commandDescription = "List the existing FATE transactions")
static class PrintOpts {}
System.exit(1);
System.err.printf("This tool has been deprecated%nFATE administration now available within 'accumulo shell'%n$ fate fail <txid>... | delete <txid>... | print [<txid>...]%n%n");
| Remove this call to "exit" or ensure it is really required. |
} else if (args[0].equals("minicluster")) {
runTMP = cl.loadClass("org.apache.accumulo.minicluster.MiniAccumuloRunner"); | Move the "minicluster" string literal on the left side of this string comparison. |
/*
* 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. |
import java.util.Set;
import org.apache.accumulo.server.test.continuous.ContinuousIngest.BaseOpts;
import com.beust.jcommander.Parameter;
import com.beust.jcommander.validators.PositiveInteger;
* A map only job that reads a table created by continuous ingest and creates doubly linked list. This map reduce job tests the ability of a map only job to read and
static class Opts extends BaseOpts {
@Parameter(names="--maxColF", description="maximum column family value to use")
short maxColF = Short.MAX_VALUE;
@Parameter(names="--maxColQ", description="maximum column qualifier value to use")
short maxColQ = Short.MAX_VALUE;
@Parameter(names="--maxMappers", description="the maximum number of mappers to use", required=true, validateWith=PositiveInteger.class)
int maxMaps = 0;
}
Opts opts = new Opts();
opts.parseArgs(ContinuousMoru.class.getName(), args);
opts.setAccumuloConfigs(job);
Set<Range> ranges = opts.getConnector().tableOperations().splitRangeByTablets(opts.tableName, new Range(), opts.maxMaps);
AccumuloInputFormat.setRanges(job.getConfiguration(), ranges);
AccumuloOutputFormat.setMaxLatency(job.getConfiguration(), (int) (opts.batchLatency / 1000.0));
AccumuloOutputFormat.setMaxMutationBufferSize(job.getConfiguration(), opts.batchMemory);
AccumuloOutputFormat.setMaxWriteThreads(job.getConfiguration(), opts.batchThreads);
conf.setLong(MIN, opts.min);
conf.setLong(MAX, opts.max);
conf.setInt(MAX_CF, opts.maxColF);
conf.setInt(MAX_CQ, opts.maxColQ);
opts.stopTracing(); | Remove this call to "exit" or ensure it is really required. |
timestampOpt = new Option("st", "show-timestamps", false, "display timestamps");
disablePaginationOpt = new Option("np", "no-pagination", false, "disable pagination of output");
showFewOpt = new Option("f", "show few", true, "show only a specified number of characters"); | Replace all tab characters in this file by sequences of white-spaces. |
/*
* 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. |
Collection<Text> remainingSplits = this.getConnector().tableOperations().listSplits(table); | Remove the redundant '!unknownSymbol!' thrown exception declaration(s). |
* 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.
*/
Node(String name) {
this.name = name;
}
byte[] value = new byte[] {};
if (node.name.equals(name)) return node;
if (depth == path.length) return root;
if (child == null) return null;
public List<String> getChildren(String path) throws DistributedStoreException {
if (node == null) return Collections.emptyList();
public void put(String path, byte[] bs) throws DistributedStoreException {
if (path.length == index) return root;
return recurseCreate(node, path, index + 1);
if (child != null) parent.children.remove(child);
Node node = navigate(path);
if (node != null) return node.value;
} catch (IllegalArgumentException ex) {}
} catch (IllegalArgumentException ex) {}
} catch (IllegalArgumentException ex) {}
// @Test
// public void testMetaDataStore() { } // see functional test | Rename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'. |
if (hasPermission)
throw new AccumuloException("Got a security exception when I should have had permission.", ae);
else
return;
if (exists)
throw new AccumuloException("Got security exception when the user should have existed", ae);
else
return;
if (!hasPermission)
throw new AccumuloException("Didn't get Security Exception when we should have"); | Remove this call to "exit" or ensure it is really required. |
if (!summarize)
log.info(key.getRow());
else
count++; | Remove this call to "exit" or ensure it is really required. |
s.close(); | Do not forget to remove this deprecated code someday. |
import org.apache.accumulo.core.client.Instance;
Instance instance = HdfsZooInstance.getInstance();
client = MasterClient.getConnectionWithRetry(instance);
stats = client.getMasterStats(Tracer.traceInfo(), SystemCredentials.get().toThrift(instance)); | Immediately return this expression instead of assigning it to the temporary variable "onlineTabletsForTable". |
import java.nio.charset.Charset;
private static final Charset utf8 = Charset.forName("UTF8");
ZooReaderWriter.getInstance().putPersistentData(zPath, value.getBytes(utf8), NodeExistsPolicy.OVERWRITE); | 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. |
public static final String ROOT_TABLET_LOCATION = "/root_tablet";
public static final String ZROOT_TABLET = ROOT_TABLET_LOCATION;
public static final KeyExtent EXTENT = new KeyExtent(new Text(ID), null, null);
public static final Range METADATA_TABLETS_RANGE = new Range(null, false, MetadataTable.RESERVED_RANGE_START_KEY, false); | 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.security.thrift.ThriftSecurityException;
import org.apache.accumulo.core.security.tokens.AccumuloToken;
import org.apache.accumulo.core.security.tokens.InstanceTokenWrapper;
public void initializeSecurity(InstanceTokenWrapper credentials, AccumuloToken<?,?> at) throws AccumuloSecurityException, ThriftSecurityException;
public boolean authenticateUser(AccumuloToken<?,?> token) throws AccumuloSecurityException;
public void createUser(AccumuloToken<?,?> user) throws AccumuloSecurityException;
public void changePassword(AccumuloToken<?,?> user) throws AccumuloSecurityException;
public String getTokenClassName(); | Immediately return this expression instead of assigning it to the temporary variable "ret". |
if (lines.size() == 0 || e.getUnknownExceptions() > 0) {
// must always print something
lines.add(" " + e.getClass().getName() + " : " + e.getMessage());
if (e.getCause() != null)
lines.add(" Caused by : " + e.getCause().getClass().getName() + " : " + e.getCause().getMessage());
}
| Replace all tab characters in this file by sequences of white-spaces. |
import org.apache.accumulo.core.security.thrift.TCredentials;
public HashMap<String,Object> getMap() {
TCredentials credentials = getCredentials();
public TCredentials getCredentials() {
return CredentialHelper.createSquelchError(username, new PasswordToken(password), this.getInstance().getInstanceID());
if (f.matches("^accumulo-core-.+jar$") || f.matches("^accumulo-server-.+jar$") || f.matches("^accumulo-fate-.+jar$")
|| f.matches("^accumulo-trace-.+jar$") || f.matches("^libthrift-.+jar$")) { | 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
protected void runLater(State state) throws Exception {
Random rand = (Random) state.get("rand");
Text row = Merge.getRandomRow(rand);
log.info("Checking " + row);
String user = state.getConnector().whoami();
Authorizations auths = state.getConnector().securityOperations().getUserAuthorizations(user);
Scanner scanner = state.getConnector().createScanner(Setup.getTableName(), auths);
scanner = new IsolatedScanner(scanner);
scanner.setRange(new Range(row));
Value v = null;
Key first = null;
for (Entry<Key,Value> entry : scanner) {
if (v == null) {
v = entry.getValue();
first = entry.getKey();
}
if (!v.equals(entry.getValue())) throw new RuntimeException("Inconsistent value at " + entry.getKey() + " was " + entry.getValue() + " should be " + v
+ " first read at " + first);
}
| Rename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'. |
import org.apache.accumulo.core.data.ByteSequence;
import org.apache.accumulo.core.data.Key;
import org.apache.accumulo.core.data.Range;
import org.apache.accumulo.core.iterators.SortedKeyValueIterator; | Either log or rethrow this exception. |
tops.setProperty(indexTableName, stem, "19,org.apache.accumulo.wikisearch.iterator.TotalAggregatingIterator");
tops.setProperty(indexTableName, stem + "*", "org.apache.accumulo.wikisearch.aggregator.GlobalIndexUidAggregator");
tops.setProperty(reverseIndexTableName, stem, "19,org.apache.accumulo.wikisearch.iterator.TotalAggregatingIterator");
tops.setProperty(reverseIndexTableName, stem + "*", "org.apache.accumulo.wikisearch.aggregator.GlobalIndexUidAggregator"); | Rename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'. |
private static final Logger log = Logger.getLogger(DefaultSecretKeyEncryptionStrategy.class);
Map<String, String> cryptoContext = context.getContext();
cipherStream.flush();
cipherStream.flush();
| Replace all tab characters in this file by sequences of white-spaces. |
if (index == offsets.length - 1)
len = data.length - offsets[index];
else
len = offsets[index + 1] - offsets[index];
if (index == offsets.length - 1)
len = data.length - offsets[index];
else
len = offsets[index + 1] - offsets[index];
if (last && level == levels.size() - 1)
return;
if (last)
levels.set(level, null);
else
levels.set(level, new IndexBlock(level, totalAdded));
if (addedLast)
throw new IllegalStateException("already added last");
if (totalAdded > 0 && !addedLast)
throw new IllegalStateException("did not call addLast");
if (pos < 0)
pos = (pos * -1) - 1;
if (parent != null)
throw new IllegalStateException();
if (indexBlock.getLevel() == 0)
return this;
if (indexBlock.getLevel() == 0)
return this;
if (currentPos == 0)
return parent.getPrevious();
if (currentPos == indexBlock.getIndex().size() - 1)
return parent.getNext();
if (node == null)
return false;
if (node == null)
return false;
if (size == null)
size = 0l;
if (count == null)
count = 0l; | Remove this call to "exit" or ensure it is really required. |
public KeyExtent tablet;
public TServerInstance oldServer;
public TServerInstance newServer;
public TabletMigration(KeyExtent extent, TServerInstance before, TServerInstance after) {
this.tablet = extent;
this.oldServer = before;
this.newServer = after;
}
public String toString() {
return tablet + ": " + oldServer + " -> " + newServer;
} | Rename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'. |
import java.util.SortedMap; | Use "Integer.toString" instead. |
@Parameter(names = {"-d", "--dump"}, description = "dump the key/value pairs")
@Parameter(names = {"--historgram"}, description = "print a histogram of the key-value sizes")
@Parameter(description = " <file> { <file> ... }")
| Extract the assignment out of this expression. |
if (m.size() == 0)
throw new IllegalArgumentException("Can not add empty mutations"); | Remove this call to "exit" or ensure it is really required. |
import org.apache.log4j.Logger;
private static final Logger log = Logger.getLogger(ZKSecurityTool.class);
log.error("Count not create hashed password", e);
log.error("Count not create hashed password", e);
log.error(e, e);
log.error("User database is corrupt; error converting system permissions", e);
log.error(e, e); | Rename the "log" logger to comply with the format "LOG(?:GER)?". |
import org.apache.accumulo.core.iterators.user.IntersectingIterator; | Remove this unused private "match" method. |
if (commandLine.getArgs().length != 0)
throw new ParseException("Extraneous arguments");
if (sampler.next())
Trace.on("gc");
if (verbose)
System.out.println("SAFEMODE: There are " + candidates.size() + " data file candidates marked for deletion.\n"
+ " Examine the log files to identify them.\n" + " They can be removed by executing: bin/accumulo gc --offline\n"
+ "WARNING: Do not run the garbage collector in offline mode unless you are positive\n"
+ " that the accumulo METADATA table is in a clean state, or that accumulo\n"
+ " has not yet been run, in the case of an upgrade.");
if (offline)
break;
if (tabletDirs == null)
continue;
if (tabletDirs.length == 0)
fs.delete(new Path(ServerConstants.getTablesDir() + "/" + delTableId), false);
if (count > 0)
log.debug("Folder has bulk processing flag: " + blipPath);
if (candidates.remove(delete))
log.debug("Candidate was still in use in the METADATA table: " + delete);
if (candidates.remove(path))
log.debug("Candidate was still in use in the METADATA table: " + path);
if (candidates.remove(delete))
log.debug("Candidate was still in use in the METADATA table: " + delete);
} else
throw new AccumuloException("Scanner over metadata table returned unexpected column : " + entry.getKey());
if (tableState != null && tableState != TableState.DELETING)
log.warn("File doesn't exist: " + p);
if (delete.charAt(i) == '/')
slashCount++; | Remove this call to "exit" or ensure it is really required. |
while (tok.incrementToken()) { | Remove the redundant '!unknownSymbol!' thrown exception declaration(s). |
import org.apache.accumulo.core.client.security.tokens.PasswordToken;
connector = instance.getConnector("user", new PasswordToken("password"));
Connector connector = instance.getConnector("user", new PasswordToken("password")); | Rename "connector" which hides the field declared at line 67. |
/**
* @param args
*/
public static void main(String[] args) throws Exception {
String rootDir = args[0];
File reportDir = new File(args[1]);
ZooReaderWriter zoo = ZooReaderWriter.getInstance();
if (zoo.exists(rootDir)) {
zoo.recursiveDelete(rootDir, NodeMissingPolicy.FAIL);
}
if (!reportDir.exists()) {
reportDir.mkdir();
} else {
File[] files = reportDir.listFiles();
if (files.length != 0) throw new Exception("dir " + reportDir + " is not empty");
}
| Rename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'. |
import java.util.List;
import com.beust.jcommander.JCommander;
import com.beust.jcommander.Parameter;
import com.beust.jcommander.ParameterException;
static class Opts {
@Parameter(names = "--min", description = "minimum row")
long minRow = 0;
@Parameter(names = "--max", description = "maximum row")
long maxRow = Long.MAX_VALUE;
@Parameter(description = "<num tablets>")
List<String> args = null;
}
Opts opts = new Opts();
JCommander jcommander = new JCommander(opts);
jcommander.setProgramName(GenSplits.class.getSimpleName());
try {
jcommander.parse(args);
} catch (ParameterException pe) {
System.err.println(pe.getMessage());
jcommander.usage();
System.exit(-1);
}
if (opts.args == null || opts.args.size() != 1) {
jcommander.usage();
int numTablets = Integer.parseInt(opts.args.get(0));
if (opts.minRow >= opts.maxRow) {
System.err.println("ERROR: min >= max");
System.exit(-1);
}
long distance = ((opts.maxRow - opts.minRow) / numTablets) + 1;
String s = String.format("%016x", split + opts.minRow); | 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.
*/ | Replace all tab characters in this file by sequences of white-spaces. |
import org.apache.accumulo.core.util.FastFormat; | 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 java.util.ArrayList;
import java.util.List;
import java.util.Random;
import org.apache.hadoop.io.Text;
/**
*
* @param rand
* A Random to use
* @return
* A two element list with first being smaller than the second, but either value (or both) can be null
*/
public static List<Text> generateRange(Random rand) {
ArrayList<Text> toRet = new ArrayList<Text>(2);
long firstLong = rand.nextLong();
long secondLong = rand.nextLong();
Text first = null, second = null;
// Having all negative values = null might be too frequent
if (firstLong >= 0)
first = new Text(String.format("%016x", firstLong & 0x7fffffffffffffffl));
if (secondLong >= 0)
second = new Text(String.format("%016x", secondLong & 0x7fffffffffffffffl));
if (first != null && second != null && first.compareTo(second) > 0) {
Text swap = first;
first = second;
second = swap;
}
toRet.add(first);
toRet.add(second);
return toRet;
} | Define a constant instead of duplicating this literal " from " 3 times. |
import org.apache.accumulo.core.security.thrift.TCredentials;
public void initializeSecurity(TCredentials itw, String rootuser) throws AccumuloSecurityException { | Rename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'. |
import org.apache.accumulo.core.client.Connector;
import org.junit.Test;
public class ServerSideErrorIT extends MacTest {
@Test
Connector c = getConnector();
c.tableOperations().create("tt");
c.tableOperations().attachIterator("tt", is);
BatchWriter bw = c.createBatchWriter("tt", new BatchWriterConfig());
Scanner scanner = c.createScanner("tt", Authorizations.EMPTY);
BatchScanner bs = c.createBatchScanner("tt", Authorizations.EMPTY, 2);
TableOperations to = c.tableOperations();
scanner = c.createScanner("tt", Authorizations.EMPTY); | Rename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'. |
if (id != null && !id.equals(tableId))
throw new ThriftTableOperationException(null, tableName, operation, TableOperationExceptionType.EXISTS, null);
if (!zk.exists(ZooUtil.getRoot(instance) + Constants.ZTABLES + "/" + tableId))
throw new ThriftTableOperationException(tableId, "", op, TableOperationExceptionType.NOTFOUND, "Table does not exists");
} else
return 100;
} else
return 50;
if (writeLock)
lock = locker.writeLock();
else
lock = locker.readLock(); | Remove this call to "exit" or ensure it is really required. |
org.apache.accumulo.core.data.thrift.TKeyExtent _elem64; // optional
org.apache.accumulo.core.data.thrift.TKeyExtent _elem69; // optional | 277 duplicated blocks of code must be removed. |
import org.apache.accumulo.core.security.tokens.UserPassToken;
conn.securityOperations().createUser(new UserPassToken(systemUserName, sysUserPass));
state.set("rootUserPass", ((UserPassToken )state.getAuthInfo().getToken()).getPassword());
WalkingSecurity.get(state).createUser(new UserPassToken(systemUserName, sysUserPass));
WalkingSecurity.get(state).changePassword(new UserPassToken(tableUserName, new byte[0])); | Immediately return this expression instead of assigning it to the temporary variable "ret". |
* 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.
*/
@Override
public void visit(State state, Properties props) throws Exception {
Connector conn = state.getConnector();
int nextId = ((Integer) state.get("nextId")).intValue();
String tableName = String.format("%s_%d", state.getString("tableNamePrefix"), nextId);
try {
conn.tableOperations().create(tableName);
String tableId = Tables.getNameToIdMap(state.getInstance()).get(tableName);
log.debug("created " + tableName + " (id:" + tableId + ")");
@SuppressWarnings("unchecked")
ArrayList<String> tables = (ArrayList<String>) state.get("tableList");
tables.add(tableName);
} catch (TableExistsException e) {
log.warn("Failed to create " + tableName + " as it already exists");
}
nextId++;
state.set("nextId", new Integer(nextId));
} | 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. |
/*
* 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.server.test;
public class FastFormat {
//this 7 to 8 times faster than String.format("%s%06d",prefix, num)
public static byte[] toZeroPaddedString(long num, int width, int radix, byte[] prefix){
byte ret[] = new byte[width+prefix.length];
if(toZeroPaddedString(ret, 0, num, width, radix, prefix) != ret.length)
throw new RuntimeException(" Did not format to expected width "+num+" "+width+" "+radix+" "+new String(prefix));
return ret;
}
public static int toZeroPaddedString(byte output[], int outputOffset, long num, int width, int radix, byte[] prefix){
if(num < 0)
throw new IllegalArgumentException();
String s = Long.toString(num, radix);
int index = outputOffset;
for(int i = 0; i < prefix.length; i++){
output[index++] = prefix[i];
}
int end = width - s.length() + index;
while(index < end)
output[index++] = '0';
for(int i = 0; i < s.length(); i++){
output[index++] = (byte) s.charAt(i);
}
return index - outputOffset;
}
} | Return empty string instead. |
import org.apache.accumulo.core.security.tokens.SecurityToken; | Replace all tab characters in this file by sequences of white-spaces. |
import org.apache.accumulo.core.client.IteratorSetting;
@Test
public void checkIterator() throws IOException, AccumuloException, AccumuloSecurityException, TableExistsException, TableNotFoundException {
String tableName = "checkIterator";
connector.tableOperations().create(tableName);
BatchWriter bw = connector.createBatchWriter(tableName, new BatchWriterConfig());
Mutation m = new Mutation("ROW1");
m.put("allowed", "CQ1", "V1");
m.put("denied", "CQ2", "V2");
m.put("allowed", "CQ3", "V3");
bw.addMutation(m);
m = new Mutation("ROW2");
m.put("allowed", "CQ1", "V1");
m.put("denied", "CQ2", "V2");
m.put("allowed", "CQ3", "V3");
bw.addMutation(m);
bw.close();
// check filter
Scanner scanner = connector.createScanner(tableName, Authorizations.EMPTY);
IteratorSetting is = new IteratorSetting(5, CustomFilter.class);
scanner.addScanIterator(is);
int count = 0;
for (Entry<Key,Value> entry : scanner) {
count++;
assertEquals("allowed", entry.getKey().getColumnFamily().toString());
}
assertEquals(4, count);
// check filter negated
scanner.clearScanIterators();
CustomFilter.setNegate(is, true);
scanner.addScanIterator(is);
count = 0;
for (Entry<Key,Value> entry : scanner) {
count++;
assertEquals("denied", entry.getKey().getColumnFamily().toString());
}
assertEquals(2, count);
assertTrue(new File("target/accumulo-maven-plugin/" + instance.getInstanceName() + "/testCheckIteratorPassed").createNewFile());
} | Rename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'. |
import org.apache.accumulo.fate.zookeeper.IZooReaderWriter;
import org.apache.accumulo.fate.zookeeper.ZooUtil.NodeMissingPolicy; | Remove this call to "exit" or ensure it is really required. |
import org.apache.accumulo.core.Constants;
private boolean readaheadInProgress = false;
private long readaheadThreshold;
this(instance, credentials, table, authorizations, range, size, timeOut, options, isolated, Constants.SCANNER_DEFAULT_READAHEAD_THRESHOLD);
}
ScannerIterator(Instance instance, Credentials credentials, Text table, Authorizations authorizations, Range range, int size, int timeOut,
ScannerOptions options, boolean isolated, long readaheadThreshold) {
this.readaheadThreshold = readaheadThreshold;
// If we want to start readahead immediately, don't wait for hasNext to be called
if (0l == readaheadThreshold) {
initiateReadAhead();
}
if (batchCount > readaheadThreshold) { | Move this constructor to comply with Java Code Conventions. |
Connector conn = new MockConnector(user, acu, this); | 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.
*/ | Replace all tab characters in this file by sequences of white-spaces. |
return getConnection(instance, preferCachedConnections, conf.getTimeInMillis(Property.GENERAL_RPC_TIMEOUT)); | 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.
*/
public int execute(String fullCommand, CommandLine cl, Shell shellState) throws Exception {
Thread.sleep((long) (secs * 1000));
| Rename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'. |
opts.root = opts.root; | Either log or rethrow this exception. |
final Set<String> filesToLoad = Collections.synchronizedSet(new HashSet<String>());
final List<String> loaded = Collections.synchronizedList(new ArrayList<String>());
loaded.add(file);
filesToLoad.removeAll(loaded); | Rename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'. |
protected void doTableOp(final Shell shellState, final String tableName) throws AccumuloException, AccumuloSecurityException, TableNotFoundException { | Remove the redundant '!unknownSymbol!' thrown exception declaration(s). |
* <p>
* See ACCUMULO-1312
*
* @since 1.6.0
public Credentials(String principal, AuthenticationToken token) {
public String getPrincipal() {
return principal;
}
public AuthenticationToken getToken() {
return token;
}
public TCredentials toThrift(Instance instance) { | Move this constructor to comply with Java Code Conventions. |
System.out.printf("ELAPSEDMS %d %d %d%n", (endTime - startTime), numEntries, numBytes); | Use isEmpty() to check whether the collection is empty or not. |
@Deprecated | Return empty string instead. |
TSERV_CLIENT, GC_CLIENT;
throw new IllegalArgumentException("Address was expected to have port but didn't. address=" + address);
throw new IllegalArgumentException("Address was expected to have port but didn't. address=" + address);
for (Service service : new Service[] { Service.TSERV_CLIENT, Service.GC_CLIENT}) { | Immediately return this expression instead of assigning it to the temporary variable "client". |
import org.apache.accumulo.core.util.shell.ShellCommandException; | Replace all tab characters in this file by sequences of white-spaces. |
public String toString() {
return this.getClass().getName();
}
@Override | 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; | Replace all tab characters in this file by sequences of white-spaces. |
import org.apache.accumulo.core.util.MetadataTable;
Scanner scanner = conn.createScanner(MetadataTable.NAME, Authorizations.EMPTY);
MetadataTable.PREV_ROW_COLUMN.fetch(scanner);
scanner.fetchColumnFamily(MetadataTable.LAST_LOCATION_COLUMN_FAMILY);
scanner.fetchColumnFamily(MetadataTable.CURRENT_LOCATION_COLUMN_FAMILY);
scanner.fetchColumnFamily(MetadataTable.FUTURE_LOCATION_COLUMN_FAMILY);
if (key.getColumnFamily().equals(MetadataTable.LAST_LOCATION_COLUMN_FAMILY)) {
if (key.getColumnFamily().equals(MetadataTable.CURRENT_LOCATION_COLUMN_FAMILY)
|| key.getColumnFamily().equals(MetadataTable.FUTURE_LOCATION_COLUMN_FAMILY)) {
if (MetadataTable.PREV_ROW_COLUMN.hasColumns(key)) { | Use "Long.toString" instead. |
* @deprecated Use {@link #lookupInstanceName(org.apache.accumulo.fate.zookeeper.ZooCache, UUID)} instead
*/
public static String lookupInstanceName(org.apache.accumulo.core.zookeeper.ZooCache zooCache, UUID instanceId) {
return lookupInstanceName((ZooCache) zooCache, instanceId);
}
/** | Do not forget to remove this deprecated code someday. |
import org.apache.accumulo.core.tabletserver.thrift.LogCopyInfo;
import org.apache.accumulo.core.util.CachedConfiguration;
import org.apache.accumulo.core.util.StringUtil;
import org.apache.accumulo.server.trace.TraceFileSystem;
import org.apache.accumulo.server.zookeeper.ZooCache;
import org.apache.hadoop.conf.Configuration;
private ZooCache zcache;
String loggerZNode;
LogCopyInfo lci = logger.startCopy(logFile.file, base);
copySize = lci.fileSize;
loggerZNode = lci.loggerZNode;
if (zcache.get(loggerZNode) == null) {
log.debug("zknode " + loggerZNode + " is gone, copy " + logFile.file + " from " + logFile.server + " assumed dead");
return true;
}
zcache = new ZooCache(); | Remove this unused method parameter "acuConf". |
// ignore any tablets that have recently split, for error logging
for (KeyExtent e2 : onlineOverlapping) {
Tablet tablet = onlineTablets.get(e2);
if (System.currentTimeMillis() - tablet.getSplitCreationTime() < RECENTLY_SPLIT_MILLIES) {
all.remove(e2);
}
}
// ignore self, for error logging
all.remove(extent);
if (all.size() > 0) {
log.error("Tablet " + extent + " overlaps previously assigned " + unopenedOverlapping + " " + openingOverlapping + " " + onlineOverlapping
+ " " + all); | Use isEmpty() to check whether the collection is empty or not. |
/*
* 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. |
@Test(timeout=60*1000)
BatchScanner bs = getConnector().createBatchScanner("bss", Authorizations.EMPTY, 4);
bs.close(); | Either log or rethrow this exception. |
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import org.apache.accumulo.core.conf.Property;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
config.setDefaultMemory(96, MemoryUnit.MEGABYTE);
assertEquals(96 * 1024 * 1024l, config.getMemory(ServerType.MASTER));
assertEquals(96 * 1024 * 1024l, config.getMemory(ServerType.TABLET_SERVER));
assertEquals(96 * 1024 * 1024l, config.getDefaultMemory());
assertEquals(256 * 1024 * 1024l, config.getMemory(ServerType.MASTER));
assertEquals(96 * 1024 * 1024l, config.getDefaultMemory());
assertEquals(96 * 1024 * 1024l, config.getMemory(ServerType.TABLET_SERVER)); | Cast one of the operands of this multiplication operation to a "long". |
/*
* 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 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]*$'. |
import org.apache.accumulo.cloudtrace.instrument.Span;
import org.apache.accumulo.cloudtrace.instrument.Trace; | Rename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'. |
import java.nio.charset.Charset;
private static final Charset utf8 = Charset.forName("UTF8");
byte[] sb = s.getBytes(utf8); | Move this variable to comply with Java Code Conventions. |
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import org.apache.hadoop.io.Writable;
public static class Article implements Writable {
public Article(){}
@Override
public void readFields(DataInput in) throws IOException {
id = in.readInt();
title = in.readUTF();
timestamp = in.readLong();
comments = in.readUTF();
text = in.readUTF();
}
@Override
public void write(DataOutput out) throws IOException {
out.writeInt(id);
out.writeUTF(title);
out.writeLong(timestamp);
out.writeUTF(comments);
out.writeUTF(text);
} | Rename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'. |
public Password(String dfault) {
value = dfault.getBytes();
}
@Override
@Parameter(names = {"-u", "--user"}, description = "Connection user")
@Parameter(names = "-p", converter = PasswordConverter.class, description = "Connection password")
@Parameter(names = "--password", converter = PasswordConverter.class, description = "Enter the connection password", password = true)
@Parameter(names = {"-z", "--keepers"}, description = "Comma separated list of zookeeper hosts (host:port,host:port)")
@Parameter(names = {"-i", "--instance"}, description = "The name of the accumulo instance")
@Parameter(names = {"-auths", "--auths"}, converter = AuthConverter.class, description = "the authorizations to use when reading or writing")
@Parameter(names = "--debug", description = "turn on TRACE-level log messages")
@Parameter(names = {"-fake", "--mock"}, description = "Use a mock Instance")
public boolean mock = false;
@Parameter(names = "--site-file", description = "Read the given accumulo site file to find the accumulo instance")
@Parameter(names = "--trace", description = "turn on distributed tracing")
@Override
public void parseArgs(String programName, String[] args, Object... others) {
TreeMap<String,String> map = new TreeMap<String,String>();
for (Entry<String,String> props : DefaultConfiguration.getInstance())
for (Entry<String,String> props : xml)
AccumuloInputFormat.setZooKeeperInstance(job, instance, zookeepers);
AccumuloOutputFormat.setZooKeeperInstance(job, instance, zookeepers); | Move this variable to comply with Java Code Conventions. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.