Diff
stringlengths
10
2k
Message
stringlengths
28
159
principal = "root";
Rename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.
import java.net.URI; protected static Configuration conf = null; protected static DefaultFileSystemManager vfs = null; protected static MiniDFSCluster cluster = null; // TODO Given that the URI for the NameNode is statically declared in config files // in src/test/resources, we have to assert the given ...
Complete the task associated to this TODO comment.
RegExFilter result = (RegExFilter) super.deepCopy(env);
Define and throw a dedicated exception instead of using a generic one.
public GCStatus getStatus(org.apache.accumulo.trace.thrift.TInfo tinfo, org.apache.accumulo.core.security.thrift.TCredentials credentials) throws org.apache.accumulo.core.client.impl.thrift.ThriftSecurityException, org.apache.thrift.TException; public GCStatus getStatus(org.apache.accumulo.trace.thrift.TInfo ti...
Move this constructor to comply with Java Code Conventions.
setEncoder(type.substring(CLASS_PREFIX.length())); testEncoder(Arrays.asList(0l, 1l)); setEncoder(VAR_LONG_ARRAY_ENCODER); setEncoder(FIXED_LONG_ARRAY_ENCODER); setEncoder(STRING_ARRAY_ENCODER);
Either log or rethrow this exception.
this.locator = new TimeoutTabletLocator(TabletLocator.getLocator(instance, new Text(table)), timeout); public static void doLookup(String server, Map<KeyExtent,List<Range>> requested, Map<KeyExtent,List<Range>> failures, Map<KeyExtent,List<Range>> unscanned,
Rename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.
import org.apache.accumulo.core.security.thrift.TCredentials; public MetaDataTableScanner(Instance instance, TCredentials auths, Range range, CurrentState state) { public MetaDataTableScanner(Instance instance, TCredentials auths, Range range) {
Rename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.
private BinaryTree<T> parent; private BinaryTree<T> left; private BinaryTree<T> right; T contents; public BinaryTree<T> getLeft() { return left; } public void setLeft(BinaryTree<T> left) { left.setParent(this); this.left = left; } public BinaryTree<T> getParent() { return p...
Rename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.
* @deprecated since 1.4, replaced by {@link org.apache.accumulo.core.iterators.user.SummingCombiner} with * {@link org.apache.accumulo.core.iterators.LongCombiner.Type#VARLEN}
Either log or rethrow this exception.
@Parameter(names = {"-t", "--table"}, required = true, description = "table to use") AccumuloInputFormat.setConnectorInfo(job, getAccumuloToken()); AccumuloInputFormat.setInputTableName(job, tableName); AccumuloInputFormat.setScanAuthorizations(job, auths); AccumuloOutputFormat.setConnectorInfo(job...
Return empty string instead.
package org.apache.accumulo.cloudtrace.instrument.receivers;
Rename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.
public class GarbageCollectorIT extends ConfigurableMacIT {
Use "Integer.toString" instead.
import org.apache.accumulo.core.cli.ScannerOpts; ScannerOpts scanOpts = new ScannerOpts(); opts.parseArgs(ContinuousQuery.class.getName(), args, scanOpts); scanner.setBatchSize(scanOpts.scanBatchSize);
Remove this unused method parameter "opts".
static final org.apache.log4j.Logger log = org.apache.log4j.Logger.getLogger(TabletServerMinCMetrics.class); private static final String METRICS_PREFIX = "tserver.minc"; private static ObjectName OBJECT_NAME = null; public TabletServerMinCMetrics() { super(); reset(); try { OBJECT_...
Rename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.
package org.apache.accumulo.examples.wikisearch.aggregator; import org.apache.accumulo.examples.wikisearch.protobuf.Uid; import org.apache.log4j.Logger;
Rename "table" which hides the field declared at line 107.
static HashSet<String> metadataSent = new HashSet<String>(); String metadataKey = entry.getKey() + METADATA_EVENT_COLUMN_FAMILY + language; if (!metadataSent.contains(metadataKey)) { Mutation mm = new Mutation(entry.getKey()); mm.put(METADATA_EVENT_COLUMN_FAMILY, language, cv, art...
Move this variable to comply with Java Code Conventions.
TabletLocationState result = new TabletLocationState(RootTable.EXTENT, futureSession, currentSession, lastSession, logs, false); if (assignment.tablet.compareTo(RootTable.EXTENT) != 0) if (assignment.tablet.compareTo(RootTable.EXTENT) != 0) if (tls.extent.compareTo(RootTable.EXTENT) != 0)
Reduce this switch case number of lines from 12 to at most 5, for example by extracting code into methods.
* Use {@link Instance#getConnector(String, byte[])} * @see Instance#getConnector(String user, byte[] password)
1 duplicated blocks of code must be removed.
import org.apache.accumulo.core.security.thrift.AuthInfo; import org.apache.accumulo.core.security.thrift.Credential; import org.apache.accumulo.core.security.thrift.tokens.SecurityToken; * @deprecated since 1.5, use {@link #getConnector(String, SecurityToken)} public abstract Connector getConnector(AuthInfo auth)...
Rename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.
package org.apache.accumulo.core.client.mapreduce.lib.util;
Either log or rethrow this exception.
return AuthenticationTokenSerializer.deserialize(toAuth.getTokenClassName(), toAuth.getToken());
Remove this hard-coded password.
import java.util.Map; import java.util.Properties; import java.util.Map.Entry; import org.apache.accumulo.core.client.security.tokens.AuthenticationToken; import org.apache.accumulo.core.client.security.tokens.PasswordToken; String principal = conf.get(Property.TRACE_PRINCIPAL); if (principal == null) ...
Rename "connector" which hides the field declared at line 67.
/** * A Combiner that interprets Values as Longs and returns the smallest Long among them. */
1 duplicated blocks of code must be removed.
Scanner scanner = conn.createScanner(Constants.METADATA_TABLE_NAME, Authorizations.EMPTY);
Remove this unused method parameter "range".
/* * 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 u...
Replace all tab characters in this file by sequences of white-spaces.
Connector connector = instance.getConnector("root", ""); AuthInfo auths = new AuthInfo("root", ByteBuffer.wrap("".getBytes()), "instance");
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 ...
Remove this hard-coded password.
import org.apache.accumulo.core.security.thrift.ThriftSecurityException;
1 duplicated blocks of code must be removed.
package org.apache.accumulo.examples.wikisearch.function;
Rename "table" which hides the field declared at line 107.
package org.apache.accumulo.test.continuous;
Move the "org.apache.accumulo.test.randomwalk.unit.CreateTable" string literal on the left side of this string comparison.
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ...
Replace all tab characters in this file by sequences of white-spaces.
/** * Given a zooCache and instanceId, look up the instance name. * * @param zooCache * @param instanceId * @return the instance name */
1 duplicated blocks of code must be removed.
package org.apache.accumulo.test;
Move the "org.apache.accumulo.test.randomwalk.unit.CreateTable" string literal on the left side of this string comparison.
ArrayList<byte[]> copy = new ArrayList<byte[]>(authsList.size()); for (byte[] auth : authsList) { byte[] bytes = new byte[auth.length]; System.arraycopy(auth, 0, bytes, 0, auth.length); copy.add(bytes); } return Collections.unmodifiableList(copy); return ByteBufferUtil.toImmutableB...
Return an empty collection instead of null.
import org.apache.accumulo.core.security.tokens.AuthenticationToken;
1 duplicated blocks of code must be removed.
import org.apache.accumulo.core.client.security.tokens.PasswordToken;
Move this constructor to comply with Java Code Conventions.
import org.apache.accumulo.core.security.tokens.SecurityToken; public void initializeSecurity(InstanceTokenWrapper credentials, SecurityToken token) throws AccumuloSecurityException { public void createUser(SecurityToken token) throws AccumuloSecurityException { public void changePassword(SecurityToken token) thr...
Either log or rethrow this exception.
import org.apache.accumulo.core.client.impl.thrift.ThriftSecurityException;
1 duplicated blocks of code must be removed.
ChunkInputFormat.setInputInfo(job.getConfiguration(), "root", "".getBytes(), "test", new Authorizations("A", "B", "C", "D")); ChunkInputFormat.setMockInstance(job.getConfiguration(), "instance1"); ChunkInputFormat.setInputInfo(job.getConfiguration(), "root", "".getBytes(), "test", new Authorizations("A", "B...
Remove this unused private "debugQuery" method.
public Authorizations auths = Authorizations.EMPTY;
Remove this unused method parameter "range".
if (e1.getAuthorizationFailuresMap().size() > 0)
Remove the literal "false" boolean value.
/* * 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 u...
Replace all tab characters in this file by sequences of white-spaces.
package org.apache.accumulo.server.mini;
Return empty string instead.
if (tablet.equals(RootTable.EXTENT)) {
Reduce this switch case number of lines from 12 to at most 5, for example by extracting code into methods.
public static void main(String[] args) throws Exception { if (args.length != 8) { throw new IllegalArgumentException("usage : " + ContinuousIngest.class.getName() + " <instance name> <zookeepers> <user> <pass> <table> <min> <max> <sleep time>"); } String instanceName = args[0]; ...
Rename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.
static public int getRandomFreePort() {
Rename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.
this(priority, name, iteratorClass, new HashMap<String,String>()); public IteratorSetting(int priority, String name, String iteratorClass, Map<String,String> properties) { public IteratorSetting(int priority, Class<? extends SortedKeyValueIterator<Key,Value>> iteratorClass, this(priority, iteratorClass.getS...
This block of commented-out lines of code should be removed.
private static final String SCHEME = "digest"; private static final String USER = "accumulo"; public ZooReaderWriter(String string, int timeInMillis, String secret) { super(string, timeInMillis, SCHEME, (USER + ":" + secret).getBytes());
Move this constructor 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 u...
Replace all tab characters in this file by sequences of white-spaces.
import static org.junit.Assert.fail; import java.util.ArrayList; import org.apache.accumulo.core.data.Range; import org.junit.Before; AccumuloInputFormat inputFormat; @Before public void before() { inputFormat = new AccumuloInputFormat(); } /** * Tests several different paths through the getSplits() ...
Either log or rethrow this exception.
import org.apache.accumulo.core.util.MapCounter; import org.apache.accumulo.server.fs.VolumeManager.FileType; Path path = fs.getFullPath(extent.getTableId().toString(), meta); locationPath = fs.getFullPath(FileType.TABLE, extent.getTableId().toString() + location.toString()); Path file = fs.getF...
Remove this unused private "FileType" constructor.
import org.apache.accumulo.core.iterators.IteratorEnvironment; import org.apache.accumulo.core.iterators.system.DeletingIterator;
Move this constructor to comply with Java Code Conventions.
import java.net.InetSocketAddress; import java.net.ServerSocket; import java.nio.channels.ServerSocketChannel; import org.apache.accumulo.core.util.AddressUtil; import org.apache.thrift.server.TThreadPoolServer; import org.apache.thrift.transport.TServerSocket; import org.apache.thrift.transport.TServerTransport; f...
Remove the literal "true" boolean value.
import org.apache.accumulo.core.security.tokens.UserPassToken; Connector connector = inst.getConnector(new UserPassToken("user", "pass"));
Immediately return this expression instead of assigning it to the temporary variable "ret".
package org.apache.accumulo.core.util.shell.commands; import java.util.Map; import java.util.Set; import java.util.Map.Entry; import org.apache.accumulo.core.client.TableNotFoundException; import org.apache.accumulo.core.util.LocalityGroupUtil; import org.apache.accumulo.core.util.shell.Shell; import org.apache.accum...
Return empty string instead.
public static final int DATA_VERSION = 4; public static final int PREV_DATA_VERSION = 3;
Remove this call to "exit" or ensure it is really required.
/* * 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 u...
Replace all tab characters in this file by sequences of white-spaces.
// TODO: use an ExecutorService, maybe a utility to do these steps throughout the server packages - ACCUMULO-1311
Make the "log" logger private static final and rename it to comply with the format "LOG(?:GER)?".
* * * this.iterations = iterations;
Replace all tab characters in this file by sequences of white-spaces.
} else if (args[0].equals("zookeeper")) { runTMP = cl.loadClass("org.apache.accumulo.server.util.ZooKeeperMain"); System.out.println("accumulo init | master | tserver | monitor | shell | admin | gc | classpath | rfile-info | login-info | tracer | proxy | zookeeper | <accumulo class> args");
Use "Long.toString" instead.
return true;
Remove the literal "false" boolean value.
return "renames a table"; }
Replace all tab characters in this file by sequences of white-spaces.
import org.apache.accumulo.cloudtrace.instrument.Tracer; import org.apache.accumulo.cloudtrace.thrift.TInfo; TInfo tinfo = Tracer.traceInfo(); client.update(tinfo, credentials, entry.getKey().toThrift(), entry.getValue().get(0).toThrift()); long usid = client.startUpdate(tinfo, credentia...
Immediately return this expression instead of assigning it to the temporary variable "client".
import org.apache.accumulo.core.iterators.user.RegExFilter; IteratorSetting iterSettings = new IteratorSetting(100, RegExFilter.class); RegExFilter.setRegexs(iterSettings, null, null, pattern, null, false); iterSettings = new IteratorSetting(100, RegExFilter.class); RegExFilter.setRegexs(iterSettings, p...
Define a constant instead of duplicating this literal "org.apache.accumulo.core.iterators.WholeRowIterator" 4 times.
import java.util.List; import org.apache.accumulo.core.client.IteratorSetting; public Map<String,List<IteratorSetting>> scanIteratorOptions = new HashMap<String,List<IteratorSetting>>(); for (Entry<String,List<IteratorSetting>> entry : scanIteratorOptions.entrySet()) { for (IteratorSetting setting : ent...
Either log or rethrow this exception.
@SuppressWarnings("all") public class NoSuchLogIDException extends Exception implements org.apache.thrift.TBase<NoSuchLogIDException, NoSuchLogIDException._Fields>, java.io.Serializable, Cloneable {
13 duplicated blocks of code must be removed.
@Test(timeout = 10 * 60 * 1000)
Either log or rethrow this exception.
private static Random rand = new SecureRandom(); @Override public String description() { return "The first rule of Accumulus is: \"You don't talk about Accumulus.\""; } @Override public int execute(String fullCommand, CommandLine cl, Shell shellState) throws Exception { if (rand.nextInt(10) ==...
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 u...
Replace all tab characters in this file by sequences of white-spaces.
@SuppressWarnings("deprecation")
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 ...
Remove this unused private "match" 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 ...
1 duplicated blocks of code must be removed.
org.apache.thrift.protocol.TList _list98 = iprot.readListBegin(); struct.iterators = new ArrayList<TIteratorSetting>(_list98.size); for (int _i99 = 0; _i99 < _list98.size; ++_i99) TIteratorSetting _elem100; // required _elem100 = new TI...
Rename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.
import org.apache.accumulo.core.security.CredentialHelper; import org.apache.accumulo.core.security.thrift.Credential; import org.apache.accumulo.core.security.thrift.tokens.PasswordToken; private Credential credentials; this.credentials = CredentialHelper.create(user, new PasswordToken().setPassword(pass), con...
Rename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.
@Override public boolean equals(Object o) { if (o == this) { return true; } if (o == null || o.getClass() != ServerMutation.class) { return false; } ServerMutation sm = (ServerMutation) o; if (sm.systemTime != systemTime) { return false; } return super.equals(o); ...
Move this variable to comply with Java Code Conventions.
import org.apache.accumulo.core.util.CachedConfiguration; import org.apache.hadoop.conf.Configuration; public static String[] getBaseDirs() { String singleNamespace = ServerConfiguration.getSiteConfiguration().get(Property.INSTANCE_DFS_DIR); String ns = ServerConfiguration.getSiteConfiguration().get(Property....
Rename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.
* {@link CredentialHelper#asBase64String(TCredentials)}. * the path to a file in the configured file system, containing the serialized, base-64 encoded {@link AuthenticationToken} with the user's * authentication * @see #setConnectorInfo(Job, String, AuthenticationToken) * @see #setConn...
Remove the redundant '!unknownSymbol!' thrown exception declaration(s).
public int execute(final String fullCommand, final CommandLine cl, final Shell shellState) throws Exception { final String tableName = OptUtil.getTableOpt(cl, shellState); final List<IteratorSetting> tableScanIterators = shellState.scanIteratorOptions.remove(tableName); if (tableScanIterators == null)...
Rename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.
package org.apache.accumulo.cloudtrace.instrument.receivers;
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...
Rename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.
import org.apache.accumulo.start.classloader.vfs.AccumuloVFSClassLoader; Class<? extends Encoder<V>> clazz = (Class<? extends Encoder<V>>) AccumuloVFSClassLoader.loadClass(encoderClass, Encoder.class);
Remove this unused private "appendProp" method.
import org.apache.accumulo.core.security.thrift.ThriftSecurityException; import org.apache.accumulo.core.tabletserver.thrift.TabletClientService.Client; import org.apache.thrift.TException; import org.apache.thrift.transport.TTransportException; /* * (non-Javadoc) * * @see org.apache.accumulo.core.client...
Either log or rethrow this exception.
import org.apache.accumulo.core.metadata.RootTable;
Rename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.
public TabletLocations lookupTablet(TabletLocation src, Text row, Text stopRow, TabletLocator parent, TCredentials credentials) throws AccumuloSecurityException, AccumuloException {
Do not override the Object.finalize() 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 u...
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 ...
Move this variable to comply with Java Code Conventions.
map.put("scanssessions", scansessions);
Replace all tab characters in this file by sequences of white-spaces.
if (dataVersion == null || dataVersion > ServerConstants.DATA_VERSION)
Make the "audit" logger private static final and rename it to comply with the format "LOG(?:GER)?".
import org.apache.accumulo.core.client.impl.thrift.ThriftSecurityException;
Move this constructor 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 u...
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...
Rename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.
private static XMLInputFactory xmlif = XMLInputFactory.newInstance(); static { } public Article extract(Reader reader) {
Move this variable to comply with Java Code Conventions.
Object obj = state.get(user + userPass); Object obj = state.get(getTabUserName() + userPass); if (obj instanceof PasswordToken) { return ((PasswordToken) obj).getPassword(); } return null;
Return an empty array instead of null.
* Autogenerated by Thrift Compiler (0.8.0) * @generated
Rename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.
import org.apache.accumulo.core.util.interpret.ScanInterpreter; import org.apache.hadoop.io.Text; public class HexFormatter implements Formatter, ScanInterpreter { private int fromChar(char b) { if (b >= '0' && b <= '9') { return (b - '0'); } else if (b >= 'a' && b <= 'f') { return (b - 'a' + 1...
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...
Rename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.
import org.apache.accumulo.core.security.Authorizations; connector.createScanner("mscant", Authorizations.EMPTY);
Remove this unused method parameter "range".
import java.io.FileNotFoundException; import java.io.IOException; import org.apache.accumulo.core.conf.AccumuloConfiguration; import org.apache.accumulo.core.file.FileUtil; import org.apache.accumulo.core.util.CachedConfiguration; import org.apache.hadoop.fs.FileStatus; import org.apache.hadoop.fs.FileSystem; import o...
Immediately return this expression instead of assigning it to the temporary variable "result".
MockUser root = new MockUser("root", new PasswordToken(new byte[0]), Authorizations.EMPTY); }
Remove this unused method parameter "range".
package org.apache.accumulo.core.util.shell.commands; import java.io.IOException; import org.apache.accumulo.core.client.AccumuloException; import org.apache.accumulo.core.client.AccumuloSecurityException; import org.apache.accumulo.core.util.shell.Shell; import org.apache.accumulo.core.util.shell.Shell.Command; impo...
Return empty string instead.