Diff
stringlengths 10
2k
| Message
stringlengths 28
159
|
---|---|
import org.apache.accumulo.core.client.AccumuloSecurityException;
} catch (RuntimeException e) {
if (e.getCause() instanceof AccumuloSecurityException) {
log.debug("BatchScan " + tableName + " failed, permission error");
} else {
throw e;
}
|
Reorder the modifiers to comply with the Java Language Specification.
|
/**
* Autogenerated by Thrift
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
*/
package org.apache.accumulo.core.tabletserver.thrift;
import java.util.Map;
import java.util.HashMap;
import org.apache.thrift.TEnum;
public enum ScanState implements org.apache.thrift.TEnum {
IDLE(0),
RUNNING(1),
QUEUED(2);
private final int value;
private ScanState(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 ScanState findByValue(int value) {
switch (value) {
case 0:
return IDLE;
case 1:
return RUNNING;
case 2:
return QUEUED;
default:
return null;
}
}
}
|
Return empty string instead.
|
import org.apache.accumulo.core.security.tokens.PasswordToken;
import org.apache.accumulo.core.security.tokens.SecurityToken;
|
Replace all tab characters in this file by sequences of white-spaces.
|
package cloudtrace.instrument;
import java.util.Random;
/**
* Sampler that returns true every N calls.
*
*/
public class CountSampler implements Sampler {
final static Random random = new Random();
final long frequency;
long count = random.nextLong();
public CountSampler(long frequency) {
this.frequency = frequency;
}
@Override
public boolean next() {
return (count++ % frequency) == 0;
}
}
|
Return empty string instead.
|
* The Hadoop configuration object
* if true, enable usage of the IsolatedScanner. Otherwise, disable.
* @param conf
* The Hadoop configuration object
* if true, enable usage of the ClientSideInteratorScanner. Otherwise, disable.
|
1 duplicated blocks of code must be removed.
|
import org.apache.accumulo.core.client.AccumuloSecurityException;
public void setAccumuloConfigs(Job job) throws AccumuloSecurityException {
AccumuloInputFormat.setConnectorInfo(job, principal, getToken());
AccumuloOutputFormat.setConnectorInfo(job, principal, getToken());
|
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.
|
private static final long serialVersionUID = 1L;
private static final Logger log = Logger.getLogger(FlushTablets.class);
String logger;
public FlushTablets(String logger) {
this.logger = logger;
}
@Override
public long isReady(long tid, Master environment) throws Exception {
return 0;
}
@Override
public Repo<Master> call(long tid, Master m) throws Exception {
// TODO move this code to isReady() and drop while loop?
// Make sure nobody is still using logs hosted on that node
Listener listener = m.getEventCoordinator().getListener();
while (m.stillMaster()) {
boolean flushed = false;
ZooTabletStateStore zooTabletStateStore = null;
try {
zooTabletStateStore = new ZooTabletStateStore();
} catch (DistributedStoreException e) {
log.warn("Unable to open ZooTabletStateStore, will retry", e);
}
MetaDataStateStore theRest = new MetaDataStateStore(null);
for (TabletStateStore store : new TabletStateStore[] {zooTabletStateStore, theRest}) {
if (store != null) {
for (TabletLocationState tabletState : store) {
for (Collection<String> logSet : tabletState.walogs) {
for (String logEntry : logSet) {
if (logger.equals(logEntry.split("/")[0])) {
TServerConnection tserver = m.getConnection(tabletState.current);
if (tserver != null) {
log.info("Requesting " + tabletState.current + " flush tablet " + tabletState.extent + " because it has a log entry " + logEntry);
tserver.flushTablet(m.getMasterLock(), tabletState.extent);
}
flushed = true;
}
}
}
if (zooTabletStateStore != null && !flushed) break;
listener.waitForEvents(1000);
return new StopLogger(logger);
}
@Override
public void undo(long tid, Master m) throws Exception {}
|
Rename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.
|
private final int maxCount = 10;
private Range range;
private Collection<ByteSequence> columnFamilies;
private boolean inclusive;
this.range = seekRange;
this.columnFamilies = columnFamilies;
this.inclusive = inclusive;
if (range.getStartKey() != null)
while (hasTop() && range.beforeStartKey(getTopKey()))
int count = 0;
if (count < maxCount) {
// it is quicker to call next if we are close, but we never know if we are close
// so give next a try a few times
getSource().next();
count++;
} else {
reseek(keyToSkip.followingKey(PartialKey.ROW_COLFAM_COLQUAL_COLVIS));
count = 0;
}
}
}
protected void reseek(Key key) throws IOException {
if (key == null)
return;
if (range.afterEndKey(key)) {
range = new Range(range.getEndKey(), true, range.getEndKey(), range.isEndKeyInclusive());
getSource().seek(range, columnFamilies, inclusive);
} else {
range = new Range(key, true, range.getEndKey(), range.isEndKeyInclusive());
getSource().seek(range, columnFamilies, inclusive);
|
Make this final field static too.
|
package org.apache.accumulo.core.util.shell.commands;
import java.io.File;
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 ExecfileCommand extends Command {
private Option verboseOption;
@Override
public String description() {
return "specifies a file containing accumulo commands to execute";
}
@Override
public int execute(String fullCommand, CommandLine cl, Shell shellState) throws Exception {
java.util.Scanner scanner = new java.util.Scanner(new File(cl.getArgs()[0]));
while (scanner.hasNextLine())
shellState.execCommand(scanner.nextLine(), true, cl.hasOption(verboseOption.getOpt()));
return 0;
}
@Override
public int numArgs() {
return 1;
}
@Override
public Options getOptions() {
Options opts = new Options();
verboseOption = new Option("v", "verbose", false, "displays command prompt as commands are executed");
opts.addOption(verboseOption);
return opts;
}
}
|
Return empty string instead.
|
import java.util.Collection;
public class Properties implements Destroyable, Map<String,char[]> {
private boolean destroyed = false;
private HashMap<String,char[]> map = new HashMap<String,char[]>();
private void checkDestroyed() {
if (destroyed)
throw new IllegalStateException();
}
checkDestroyed();
return map.put(key, toPut);
checkDestroyed();
@Override
public int size() {
checkDestroyed();
return map.size();
}
@Override
public boolean isEmpty() {
checkDestroyed();
return map.isEmpty();
}
@Override
public boolean containsKey(Object key) {
checkDestroyed();
return map.containsKey(key);
}
@Override
public boolean containsValue(Object value) {
checkDestroyed();
return map.containsValue(value);
}
@Override
public char[] get(Object key) {
checkDestroyed();
return map.get(key);
}
@Override
public char[] put(String key, char[] value) {
checkDestroyed();
return map.put(key, value);
}
@Override
public char[] remove(Object key) {
checkDestroyed();
return map.remove(key);
}
@Override
public void putAll(Map<? extends String,? extends char[]> m) {
checkDestroyed();
map.putAll(m);
}
@Override
public void clear() {
checkDestroyed();
map.clear();
}
@Override
public Set<String> keySet() {
checkDestroyed();
return map.keySet();
}
@Override
public Collection<char[]> values() {
checkDestroyed();
return map.values();
}
@Override
public Set<java.util.Map.Entry<String,char[]>> entrySet() {
checkDestroyed();
return map.entrySet();
}
|
Remove this hard-coded password.
|
package org.apache.accumulo.examples.wikisearch.ingest;
import org.apache.accumulo.core.client.BatchWriter;
import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.client.MutationsRejectedException;
import org.apache.accumulo.core.client.Scanner;
import org.apache.accumulo.core.client.mock.MockInstance;
import org.apache.accumulo.core.data.Key;
import org.apache.accumulo.core.data.Mutation;
import org.apache.accumulo.core.data.Range;
import org.apache.accumulo.core.data.Value;
import org.apache.accumulo.core.security.Authorizations;
import org.apache.accumulo.examples.wikisearch.ingest.WikipediaConfiguration;
import org.apache.accumulo.examples.wikisearch.ingest.WikipediaMapper;
import org.apache.accumulo.examples.wikisearch.reader.AggregatingRecordReader;
|
Rename "table" which hides the field declared at line 107.
|
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
* override the time values in the input files, and use the current time for all mutations
*
*
*
*
*
*
*
*
*
*
*
*
*
*
|
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.examples.simple.dirlist;
import org.apache.accumulo.examples.simple.filedata.FileDataQuery;
|
Rename "table" which hides the field declared at line 107.
|
ToolRunner.run(CachedConfiguration.getInstance(), new TeraSortIngest(), args);
|
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.
*/
package org.apache.accumulo.fate.util;
import org.apache.log4j.Logger;
public class UtilWaitThread {
private static final Logger log = Logger.getLogger(UtilWaitThread.class);
public static void sleep(long millis) {
try {
Thread.sleep(millis);
} catch (InterruptedException e) {
log.error(e.getMessage(), e);
}
}
}
|
Remove this call to "exit" or ensure it is really required.
|
if (name.equals("int") || name.equals("I"))
primitives += SizeConstants.SIZEOF_INT;
else if (name.equals("long") || name.equals("J"))
primitives += SizeConstants.SIZEOF_LONG;
else if (name.equals("boolean") || name.equals("Z"))
primitives += SizeConstants.SIZEOF_BOOLEAN;
else if (name.equals("short") || name.equals("S"))
primitives += SizeConstants.SIZEOF_SHORT;
else if (name.equals("byte") || name.equals("B"))
primitives += SizeConstants.SIZEOF_BYTE;
else if (name.equals("char") || name.equals("C"))
primitives += SizeConstants.SIZEOF_CHAR;
else if (name.equals("float") || name.equals("F"))
primitives += SizeConstants.SIZEOF_FLOAT;
else if (name.equals("double") || name.equals("D"))
primitives += SizeConstants.SIZEOF_DOUBLE;
|
Remove this call to "exit" or ensure it is really required.
|
package org.apache.accumulo.server.util;
import org.apache.accumulo.core.util.Daemon;
import org.apache.accumulo.core.util.UtilWaitThread;
import org.apache.log4j.Logger;
public class Halt {
static private Logger log = Logger.getLogger(Halt.class);
public static void halt(final String msg) {
halt(0, new Runnable() {
public void run() {
log.fatal(msg);
}
});
}
public static void halt(final String msg, int status) {
halt(status, new Runnable() {
public void run() {
log.fatal(msg);
}
});
}
public static void halt(final int status, Runnable runnable) {
try {
// give ourselves a little time to try and do something
new Daemon() {
public void run() {
UtilWaitThread.sleep(100);
Runtime.getRuntime().halt(status);
}
}.start();
if (runnable != null)
runnable.run();
Runtime.getRuntime().halt(status);
} finally {
// In case something else decides to throw a Runtime exception
Runtime.getRuntime().halt(-1);
}
}
}
|
Return empty string instead.
|
shellState.getReader().println(entry.getKey() + "=" + LocalityGroupUtil.encodeColumnFamilies(entry.getValue()));
|
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.
*/
Map<String,String> map;
MockConfiguration(Map<String,String> settings) {
public void put(String k, String v) {
public Iterator<Entry<String,String>> iterator() {
|
Rename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.
|
Assert.assertEquals(info.extent, info2.extent);
|
Reduce this switch case number of lines from 12 to at most 5, for example by extracting code into methods.
|
if (tls == null)
return;
|
Extract the assignment out of this expression.
|
/*
* 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.
*/
@SuppressWarnings("all") public enum CompactionReason implements org.apache.thrift.TEnum {
|
Rename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.
|
@Test(timeout = 4 * 60 * 1000)
|
Either log or rethrow this exception.
|
/**
* Deletes the ranges specified by {@link #setRanges}.
*
* @throws MutationsRejectedException
* this can be thrown when deletion mutations fail
* @throws TableNotFoundException
* when the table does not exist
*/
/**
* Releases any resources.
*/
|
1 duplicated blocks of code must be removed.
|
import org.apache.accumulo.core.client.BatchWriterConfig;
BatchWriter bw = connector.createBatchWriter(table, new BatchWriterConfig());
|
Remove this unused method parameter "e".
|
import org.apache.accumulo.core.client.impl.thrift.SecurityErrorCode;
|
1 duplicated blocks of code must be removed.
|
import org.apache.log4j.Logger;
import sample.Results;
private static final String XSL = "/accumulo-sample/style.xsl";
u = new URL("http://" + System.getProperty("jboss.bind.address") + ":" + System.getProperty("jboss.web.http.port") + XSL);
|
Either log or rethrow this exception.
|
long startTime = System.currentTimeMillis();
if (System.currentTimeMillis() - startTime > 2 * timeout)
throw new RuntimeException("Failed to connect to zookeeper (" + host + ") within 2x zookeeper timeout period " + timeout);
|
Define and throw a dedicated exception instead of using a generic one.
|
* 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 static void main(String[] args) throws IOException, AccumuloException, AccumuloSecurityException, TableNotFoundException {
if (args.length != 5) throw new RuntimeException("Usage: bin/accumulo " + BulkImportDirectory.class.getName()
+ " <username> <password> <tablename> <sourcedir> <failuredir>");
final String user = args[0];
final byte[] pass = args[1].getBytes();
final String tableName = args[2];
final String dir = args[3];
final String failureDir = args[4];
final Path failureDirPath = new Path(failureDir);
final FileSystem fs = FileSystem.get(CachedConfiguration.getInstance());
fs.delete(failureDirPath, true);
fs.mkdirs(failureDirPath);
HdfsZooInstance.getInstance().getConnector(user, pass).tableOperations().importDirectory(tableName, dir, failureDir, false);
}
|
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 static org.junit.Assert.fail;
import java.io.IOException;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.apache.accumulo.server.mini.MiniAccumuloCluster;
|
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 static String format(long traceId, long spanId, long parentId, long start, long stop, String description, Map<String,String> data) {
if (parentId > 0) parentStr = " parent:" + parentId;
return String.format("%20s:%x id:%d%s start:%s ms:%d", description, traceId, spanId, parentStr, startStr, stop - start);
public void span(long traceId, long spanId, long parentId, long start, long stop, String description, Map<String,String> data) {
public void flush() {}
|
Rename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.
|
boolean cloudTableUserExists = conn.securityOperations().listLocalUsers().contains(WalkingSecurity.get(state).getTabUserName());
|
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.
*/
|
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.
*/
*
metadata.setBatchSize(1000 * 1000);
for (Entry<Key,Value> entry : metadata) {
Path map = new Path(ServerConstants.getTablesDir() + "/" + table + key.getColumnQualifier().toString());
|
Rename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.
|
/**
* See {@link #ColumnVisibility(byte[])}
*
* @param expression
* @param encoding
* uses this encoding to convert the expression to a byte array
* @throws UnsupportedEncodingException
*/
public ColumnVisibility(String expression, String encoding) throws UnsupportedEncodingException {
this(expression.getBytes(encoding));
}
return quote(term, "UTF-8");
}
/**
* see {@link #quote(byte[])}
*
*/
public static String quote(String term, String encoding) {
return new String(quote(term.getBytes(encoding)), encoding);
|
Move this constructor to comply with Java Code Conventions.
|
InputStream fis = null;
int numRead = 0;
try {
fis = new FileInputStream(filename);
numRead = fis.read(buf);
while (numRead >= 0) {
if (numRead > 0) {
md5digest.update(buf, 0, numRead);
}
numRead = fis.read(buf);
}
} finally {
if (fis != null) {
fis.close();
try {
fis = new FileInputStream(filename);
numRead = fis.read(buf);
while (numRead >= 0) {
while (numRead < buf.length) {
int moreRead = fis.read(buf, numRead, buf.length - numRead);
if (moreRead > 0)
numRead += moreRead;
else if (moreRead < 0)
break;
}
m = new Mutation(row);
Text chunkCQ = new Text(chunkSizeBytes);
chunkCQ.append(intToBytes(chunkCount), 0, 4);
m.put(CHUNK_CF, chunkCQ, cv, new Value(buf, 0, numRead));
bw.addMutation(m);
if (chunkCount == Integer.MAX_VALUE)
throw new RuntimeException("too many chunks for file " + filename + ", try raising chunk size");
chunkCount++;
numRead = fis.read(buf);
}
} finally {
if (fis != null) {
fis.close();
}
|
Replace all tab characters in this file by sequences of white-spaces.
|
private Option verboseOption;
@Override
public String description() {
return "displays information about this program";
}
@Override
public int execute(String fullCommand, CommandLine cl, Shell shellState) throws IOException {
shellState.printInfo();
if (cl.hasOption(verboseOption.getOpt())) shellState.printVerboseInfo();
return 0;
}
@Override
public int numArgs() {
return 0;
}
@Override
public Options getOptions() {
Options opts = new Options();
verboseOption = new Option("v", "verbose", false, "displays details session information");
opts.addOption(verboseOption);
return opts;
}
|
Rename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.
|
pass = passw.getBytes();
authFailed = !connector.securityOperations().authenticateUser(connector.whoami(), pwd.getBytes());
|
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.
*/
|
Replace all tab characters in this file by sequences of white-spaces.
|
* the relevant tableInfo for the security violation
* the relevant tableInfo for the security violation
@Override
if (!StringUtils.isEmpty(tableInfo)) {
|
Immediately return this expression instead of assigning it to the temporary variable "result".
|
public int execute(final String fullCommand, final CommandLine cl, final Shell shellState) throws Exception {
final String tableName = OptUtil.getTableOpt(cl, shellState);
final String name = cl.getOptionValue(nameOpt.getOpt());
final EnumSet<IteratorScope> scopes = EnumSet.noneOf(IteratorScope.class);
if (cl.hasOption(mincScopeOpt.getOpt())) {
}
if (cl.hasOption(majcScopeOpt.getOpt())) {
}
if (cl.hasOption(scanScopeOpt.getOpt())) {
}
if (scopes.isEmpty()) {
}
final Options o = new Options();
|
Rename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.
|
package org.apache.accumulo.core.iterators;
import java.io.IOException;
import org.apache.accumulo.core.conf.AccumuloConfiguration;
import org.apache.accumulo.core.data.Key;
import org.apache.accumulo.core.data.Value;
import org.apache.accumulo.core.file.map.MyMapFile;
import org.apache.accumulo.core.file.map.MyMapFile.Reader;
import org.apache.accumulo.core.iterators.IteratorEnvironment;
import org.apache.accumulo.core.iterators.SortedKeyValueIterator;
import org.apache.accumulo.core.iterators.IteratorUtil.IteratorScope;
import org.apache.accumulo.core.util.CachedConfiguration;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FileSystem;
public class DefaultIteratorEnvironment implements IteratorEnvironment {
AccumuloConfiguration conf;
public DefaultIteratorEnvironment(AccumuloConfiguration conf) {
this.conf = conf;
}
public DefaultIteratorEnvironment() {
this.conf = AccumuloConfiguration.getDefaultConfiguration();
}
@Override
public Reader reserveMapFileReader(String mapFileName)
throws IOException {
Configuration conf = CachedConfiguration.getInstance();
FileSystem fs = FileSystem.get(conf);
return new MyMapFile.Reader(fs,mapFileName,conf);
}
@Override
public AccumuloConfiguration getConfig() {
return conf;
}
@Override
public IteratorScope getIteratorScope() {
throw new UnsupportedOperationException();
}
@Override
public boolean isFullMajorCompaction() {
throw new UnsupportedOperationException();
}
@Override
public void registerSideChannel(SortedKeyValueIterator<Key, Value> iter) {
throw new UnsupportedOperationException();
}
}
|
Return empty string instead.
|
private final Object closeLock = new Object();
|
Move this variable to comply with Java Code Conventions.
|
+ this.username + ", password = [hidden]. Check values in ejb-jar.xml");
log.info("Connecting to [instanceName = " + this.instanceName + ", zookeepers = " + this.zooKeepers + ", username = " + this.username + "].");
|
Remove this unused method parameter "tservers".
|
switch (ae.getSecurityErrorCode()) {
|
Do not forget to remove this deprecated code someday.
|
if (end == null)
end = new Date(System.currentTimeMillis());
if (socket != null && socket.isConnected())
socket.getOutputStream().write(out.getBytes());
else
System.err.println("Unable to send data to transport");
if (socket != null && socket.isConnected())
socket.close();
if (!match.matches())
return null;
if (null != dateFilter && !dateFilter.containsLong(ts))
return null;
if (cl.hasOption(o.getOption("f").getOpt()))
fileNameFilter = cl.getOptionValue(o.getOption("f").getOpt());
if (cl.hasOption(o.getOption("m").getOpt()))
msgFilter = cl.getOptionValue(o.getOption("m").getOpt());
if (cl.hasOption(o.getOption("l").getOpt()))
levelFilter = cl.getOptionValue(o.getOption("l").getOpt());
|
Remove this call to "exit" or ensure it is really required.
|
if (rand.nextInt(20) == 0)
range.set(0, null);
if (rand.nextInt(20) == 0)
range.set(1, null);
|
Remove this call to "exit" or ensure it is really required.
|
package org.apache.accumulo.examples.wikisearch.util;
|
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.util.NamingThreadFactory;
|
Rename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.
|
log.info("starting at " + start + " for user " + opts.principal);
|
Rename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.
|
cfg.setSiteConfig(siteConfig);
cfg.useMiniDFS(true);
@Test(timeout=100*1000)
@Test(timeout=120*1000)
UtilWaitThread.sleep(1000);
// don't need the regular tablet server
cluster.killProcess(ServerType.TABLET_SERVER, cluster.getProcesses().get(ServerType.TABLET_SERVER).iterator().next());
UtilWaitThread.sleep(1000);
assertEquals(1, c.instanceOperations().getTabletServers().size());
ingest.waitFor();
tserver.waitFor();
|
Rename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.
|
@Deprecated
|
Return empty string instead.
|
@Deprecated
|
Return empty string instead.
|
Connector conn = new ZooKeeperInstance(accumulo.getInstanceName(), accumulo.getZookeepers()).getConnector("root", "superSecret");
conn.securityOperations().createUser("user1", "pass1".getBytes());
Connector uconn = new ZooKeeperInstance(accumulo.getInstanceName(), accumulo.getZookeepers()).getConnector("user1", "pass1");
Connector conn = new ZooKeeperInstance(accumulo.getInstanceName(), accumulo.getZookeepers()).getConnector("root", "superSecret");
folder.delete();
|
Rename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.
|
package org.apache.accumulo.examples.simple.mapreduce.bulk;
|
Rename "table" which hides the field declared at line 107.
|
try {
bs.setRanges(Collections.singleton(Constants.NON_ROOT_METADATA_KEYSPACE));
bs.fetchColumnFamily(Constants.METADATA_DATAFILE_COLUMN_FAMILY);
IteratorSetting cfg = new IteratorSetting(40, "grep", GrepIterator.class);
GrepIterator.setTerm(cfg, "../" + tableId + "/");
bs.addScanIterator(cfg);
for (Entry<Key,Value> entry : bs) {
if (entry.getKey().getColumnQualifier().toString().startsWith("../" + tableId + "/")) {
refCount++;
}
} finally {
bs.close();
|
Move the "print" string literal on the left side of this string comparison.
|
@Override
public void visit(State state, Properties props) throws Exception {
BatchWriter bw = state.getMultiTableBatchWriter().getBatchWriter(state.getString("seqTableName"));
state.set("numWrites", state.getInteger("numWrites") + 1);
Integer totalWrites = state.getInteger("totalWrites") + 1;
if ((totalWrites % 10000) == 0) {
log.debug("Total writes: " + totalWrites);
state.set("totalWrites", totalWrites);
Mutation m = new Mutation(new Text(String.format("%010d", totalWrites)));
m.put(new Text("cf"), new Text("cq"), new Value(new String("val").getBytes()));
bw.addMutation(m);
}
|
Rename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.
|
if (currentTerm == null)
return;
if (!(currentTerm.iter.hasTop()) || ((currentTerm.term != null) && (currentTerm.term.compareTo(currentTerm.iter.getTopKey().getColumnFamily()) != 0)))
currentTerm = null;
if (currentTerm != null)
sorted.add(currentTerm);
if (currentTerm == null)
currentTerm = sources.get(0);
if ((range.getStartKey() == null) || (range.getStartKey().getRow() == null))
newRange = range;
if (range.getStartKey().getColumnQualifier() == null)
newKey = new Key(range.getStartKey().getRow(), (currentTerm.term == null) ? nullText : currentTerm.term);
else
newKey = new Key(range.getStartKey().getRow(), (currentTerm.term == null) ? nullText : currentTerm.term, range.getStartKey().getColumnQualifier());
if (!(currentTerm.iter.hasTop()) || ((currentTerm.term != null) && (currentTerm.term.compareTo(currentTerm.iter.getTopKey().getColumnFamily()) != 0)))
currentTerm = null;
if ((TS.iter.hasTop()) && ((TS.term != null) && (TS.term.compareTo(TS.iter.getTopKey().getColumnFamily()) == 0)))
sorted.add(TS);
if ((range.getStartKey() == null) || (range.getStartKey().getRow() == null))
newRange = range;
if (range.getStartKey().getColumnQualifier() == null)
newKey = new Key(range.getStartKey().getRow(), (TS.term == null) ? nullText : TS.term);
else
newKey = new Key(range.getStartKey().getRow(), (TS.term == null) ? nullText : TS.term, range.getStartKey().getColumnQualifier());
if (!(TS.iter.hasTop()) || ((TS.term != null) && (TS.term.compareTo(TS.iter.getTopKey().getColumnFamily()) != 0)))
iter.remove();
|
Remove this call to "exit" or ensure it is really required.
|
public class MergeMetaIT extends SimpleMacIT {
|
Rename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.
|
FileInputStream fis = new FileInputStream(sitePath);
scaleProps.load(fis);
fis.close();
fis = new FileInputStream(testPath);
testProps.load(fis);
|
Remove this unused method parameter "tservers".
|
* @deprecated since 1.4, replaced by {@link org.apache.accumulo.core.iterators.user.SummingCombiner} with
* {@link org.apache.accumulo.core.iterators.LongCombiner.Type#FIXEDLEN}
|
Do not forget to remove this deprecated code someday.
|
for (String entry : iterator.next().logSet) {
String parts[] = entry.split("/", 2);
String filename = parts[1];
|
Move the array designator from the variable to the type.
|
* This is a test to ensure the string literal in {@link ConnectorImpl#ConnectorImpl(Instance, Credentials)} is kept up-to-date if we move the
|
Immediately return this expression instead of assigning it to the temporary variable "onlineTabletsForTable".
|
private Mutation parent;
public ColumnUpdate(byte[] cf, byte[] cq, byte[] cv, boolean hasts, long ts, boolean deleted, byte[] val, Mutation m) {
this.parent = m;
// @Deprecated use org.apache.accumulo.data.Mutation#setSystemTimestamp(long);
parent.setSystemTimestamp(v);
if (hasTimestamp)
return this.timestamp;
return parent.systemTime;
|
This block of commented-out lines of code should be removed.
|
package org.apache.accumulo.server.master.state;
import org.apache.accumulo.server.master.state.DistributedStoreException;
public class IllegalDSException extends DistributedStoreException {
public IllegalDSException(String why) {
super(why);
}
private static final long serialVersionUID = 1L;
}
|
Move this variable to comply with Java Code Conventions.
|
}
private void addOptions(StringBuilder sb, StatType selectedStatType) {
for (StatType st : StatType.values()) {
sb.append("<option").append(st.equals(selectedStatType) ? " selected='true'>" : ">").append(st.getDescription()).append("</option>");
}
}
private void doScript(StringBuilder sb, ArrayList<TabletServerStatus> tservers) {
|
Remove this unused method parameter "tservers".
|
import java.io.IOException;
import org.apache.accumulo.core.util.CachedConfiguration;
import org.apache.hadoop.fs.FileSystem;
acu = new MockAccumulo(getDefaultFileSystem());
static FileSystem getDefaultFileSystem() {
try {
return FileSystem.get(CachedConfiguration.getInstance());
} catch (IOException ex) {
throw new RuntimeException(ex);
}
}
this(instanceName, getDefaultFileSystem());
}
public MockInstance(String instanceName, FileSystem fs) {
instances.put(instanceName, acu = new MockAccumulo(fs));
|
Rename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.
|
public <T extends Mutation> void binMutations(List<T> mutations, Map<String,TabletServerMutations<T>> binnedMutations, List<T> failures,
TCredentials credentials) throws AccumuloException, AccumuloSecurityException, TableNotFoundException {
TabletServerMutations<T> tsm = new TabletServerMutations<T>();
for (T mutation : mutations) {
|
Rename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.
|
package org.apache.accumulo.examples.simple.filedata;
import org.apache.accumulo.examples.simple.filedata.KeyUtil;
|
Rename "table" which hides the field declared at line 107.
|
/*
* 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.fate.Repo;
|
Remove this call to "exit" or ensure it is really required.
|
shellState.getReader().println("Not deleting unbounded range. Specify both ends, or use --force");
|
Rename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.
|
* A SortedKeyValueIterator that combines the Values for different versions (timestamps) of a Key into a single Value. Combiner will replace one or more
* versions of a Key and their Values with the most recent Key and a Value which is the result of the reduce method.
* This reduce method will be passed the most recent Key and an iterator over the Values for all non-deleted versions of that Key. A combiner will not combine
* keys that differ by more than the timestamp.
try {
combineAllColumns = Boolean.parseBoolean(options.get(ALL_OPTION));
} catch (Exception e) {
throw new IllegalArgumentException("bad boolean " + ALL_OPTION + ":" + options.get(ALL_OPTION));
}
throw new IllegalArgumentException("options must include " + ALL_OPTION + " or " + COLUMNS_OPTION);
throw new IllegalArgumentException("empty columns specified in option " + COLUMNS_OPTION);
throw new IllegalArgumentException("invalid column encoding " + encodedColumns);
|
Return empty string instead.
|
import org.apache.accumulo.server.fs.VolumeManager;
VolumeManager fs;
String work = new String(data);
String[] parts = work.split("\\|");
String src = parts[0];
String dest = parts[1];
String sortId = new Path(src).getName();
log.debug("Sorting " + src + " to " + dest + " using sortId " + sortId);
if (currentWork.containsKey(sortId))
currentWork.put(sortId, this);
sort(sortId, new Path(src), dest);
currentWork.remove(sortId);
fs.deleteRecursively(new Path(destPath));
Path path = new Path(destPath, String.format("part-r-%05d", part++));
FileSystem ns = fs.getFileSystemByPath(path);
MapFile.Writer output = new MapFile.Writer(ns.getConf(), ns, path.toString(), LogFileKey.class, LogFileValue.class);
public LogSorter(Instance instance, VolumeManager fs, AccumuloConfiguration conf) {
|
Rename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.
|
package org.apache.accumulo.core.util.shell.commands;
import org.apache.accumulo.core.Constants;
import org.apache.accumulo.core.client.AccumuloException;
import org.apache.accumulo.core.client.AccumuloSecurityException;
import org.apache.accumulo.core.client.TableNotFoundException;
import org.apache.accumulo.core.util.shell.Shell;
import org.apache.accumulo.core.util.shell.Shell.TableOperation;
public class OnlineCommand extends TableOperation {
@Override
public String description() {
return "starts the process of putting a table online";
}
protected void doTableOp(Shell shellState, String tableName) throws AccumuloException, AccumuloSecurityException, TableNotFoundException {
if (tableName.equals(Constants.METADATA_TABLE_NAME)) {
Shell.log.info(" The " + Constants.METADATA_TABLE_NAME + " is always online.");
} else {
Shell.log.info("Attempting to begin bringing " + tableName + " online");
shellState.getConnector().tableOperations().online(tableName);
}
}
}
|
Return empty string instead.
|
package org.apache.accumulo.fate.zookeeper;
import org.apache.accumulo.fate.util.UtilWaitThread;
public ZooSessionInfo(ZooKeeper zooKeeper, ZooWatcher watcher) {
private static class ZooWatcher implements Watcher {
ZooWatcher watcher = new ZooWatcher();
|
Remove this call to "exit" or ensure it is really required.
|
* Autogenerated by Thrift Compiler (0.9.0)
import org.apache.thrift.protocol.TProtocolException;
import org.apache.thrift.EncodingUtils;
import org.apache.thrift.TException;
// check for sub-struct validity
if (last != null) {
last.validate();
}
if (lastLog != null) {
lastLog.validate();
}
if (current != null) {
current.validate();
}
if (currentLog != null) {
currentLog.validate();
}
|
Rename this class name to match the regular expression '^[A-Z][a-zA-Z0-9]*$'.
|
public ScannerTranslator(final Scanner scanner) {
public void init(final SortedKeyValueIterator<Key,Value> source, final Map<String,String> options, final IteratorEnvironment env) throws IOException {
public void seek(final Range range, final Collection<ByteSequence> columnFamilies, final boolean inclusive) throws IOException {
if (!inclusive && columnFamilies.size() > 0) {
}
public SortedKeyValueIterator<Key,Value> deepCopy(final IteratorEnvironment env) {
public ClientSideIteratorScanner(final Scanner scanner) {
public void setSource(final Scanner scanner) {
final TreeMap<Integer,IterInfo> tm = new TreeMap<Integer,IterInfo>();
public SortedKeyValueIterator<Key,Value> reserveMapFileReader(final String mapFileName) throws IOException {
public void registerSideChannel(final SortedKeyValueIterator<Key,Value> iter) {}
final Set<ByteSequence> colfs = new TreeSet<ByteSequence>();
public void setTimeOut(final int timeOut) {
public void setRange(final Range range) {
public void setBatchSize(final int size) {
|
Move this constructor to comply with Java Code Conventions.
|
public FileCFSkippingIterator(FileSKVIterator src) {
super(src);
}
protected FileCFSkippingIterator(SortedKeyValueIterator<Key,Value> src, Set<ByteSequence> colFamSet, boolean inclusive) {
super(src, colFamSet, inclusive);
}
@Override
public SortedKeyValueIterator<Key,Value> deepCopy(IteratorEnvironment env) {
return new FileCFSkippingIterator(getSource().deepCopy(env), colFamSet, inclusive);
}
@Override
public void closeDeepCopies() throws IOException {
((FileSKVIterator) getSource()).closeDeepCopies();
}
@Override
public void close() throws IOException {
((FileSKVIterator) getSource()).close();
}
@Override
public Key getFirstKey() throws IOException {
return ((FileSKVIterator) getSource()).getFirstKey();
}
@Override
public Key getLastKey() throws IOException {
return ((FileSKVIterator) getSource()).getLastKey();
}
@Override
public DataInputStream getMetaStore(String name) throws IOException {
return ((FileSKVIterator) getSource()).getMetaStore(name);
}
|
Rename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.
|
import org.apache.accumulo.core.client.security.SecurityErrorCode;
|
Do not forget to remove this deprecated code someday.
|
@Deprecated
|
Remove this unused method parameter "ex".
|
@Override
public int execute(String fullCommand, CommandLine cl, Shell shellState) throws IOException {
for (String p : SystemPermission.printableValues())
shellState.getReader().printString(p + "\n");
return 0;
}
@Override
public String description() {
return "displays a list of valid system permissions";
}
@Override
public int numArgs() {
return 0;
}
|
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.
|
/**
* @deprecated since 1.4
* @use org.apache.accumulo.core.iterators.user.SummingArrayCombiner with SummingArrayCombiner.Type.VARNUM
*/
|
Either log or rethrow this exception.
|
import org.apache.accumulo.trace.instrument.TraceRunnable;
import org.apache.accumulo.trace.instrument.Tracer;
|
Remove the redundant '!unknownSymbol!' thrown exception declaration(s).
|
import org.apache.accumulo.core.client.BatchWriterConfig;
BatchWriter bw = connector.createBatchWriter(Constants.METADATA_TABLE_NAME, new BatchWriterConfig());
|
Remove this unused method parameter "e".
|
* 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.
*/
|
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.
|
import org.apache.accumulo.core.security.tokens.InstanceTokenWrapper;
import org.apache.accumulo.core.security.tokens.UserPassToken;
InstanceTokenWrapper auth = getAuthInfo();
public InstanceTokenWrapper getAuthInfo() {
return new InstanceTokenWrapper(new UserPassToken(username, ByteBuffer.wrap(password.getBytes())), this.getInstance().getInstanceID());
|
Immediately return this expression instead of assigning it to the temporary variable "ret".
|
bs.setTimeout(1, TimeUnit.SECONDS);
|
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 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.
*/
private static final Logger log = Logger.getLogger(UtilWaitThread.class);
public static void sleep(long millis) {
try {
Thread.sleep(millis);
} catch (InterruptedException e) {
log.error(e.getMessage(), e);
}
}
|
Rename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.
|
import org.apache.hadoop.net.SocketInputStream;
import org.apache.hadoop.net.SocketOutputStream;
InputStream input = new BufferedInputStream(new SocketInputStream(socket, timeoutMillis), 1024 * 10);
OutputStream output = new BufferedOutputStream(new SocketOutputStream(socket, timeoutMillis), 1024 * 10);
|
Remove this call to "exit" or ensure it is really required.
|
String import_ = "file://" + folder.newFolder().toString();
assertEquals(2, output.get().split("\n").length);
exec("getsplits -t !!ROOT", true);
assertEquals(1, output.get().split("\n").length);
assertEquals(1, output.get().split("\n").length);
|
Reduce this switch case number of lines from 12 to at most 5, for example by extracting code into methods.
|
* Initiates taking a table offline, but does not wait for action to complete
* the table to take offline
* @param wait
* if true, then will not return until table is offline
* @throws AccumuloException
* when there is a general accumulo error
* @throws AccumuloSecurityException
* when the user does not have the proper permissions
* @throws TableNotFoundException
* @since 1.6.0
*/
public void offline(String tableName, boolean wait) throws AccumuloSecurityException, AccumuloException, TableNotFoundException;
/**
* Initiates bringing a table online, but does not wait for action to complete
*
* @param tableName
/**
*
* @param tableName
* the table to take online
* @param wait
* if true, then will not return until table is online
* @throws AccumuloException
* when there is a general accumulo error
* @throws AccumuloSecurityException
* when the user does not have the proper permissions
* @throws TableNotFoundException
* @since 1.6.0
*/
public void online(String tableName, boolean wait) throws AccumuloSecurityException, AccumuloException, TableNotFoundException;
|
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.
*/
public class VisibilityInterpreterFactory {
public static VisibilityInterpreter create() {
if (interpreter == null) {
throw new IllegalStateException("ColumnVisibilityInterpreterFactory is not configured: Interpreter is null");
public static VisibilityInterpreter create(ColumnVisibility cv, Authorizations authorizations) {
if (interpreter == null) {
throw new IllegalStateException("ColumnVisibilityInterpreterFactory is not configured: Interpreter is null");
public static void setInterpreter(VisibilityInterpreter interpreter) {
|
Rename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.