Skip to content

Commit

Permalink
ACCUMULO-4685 Remove unneeded code
Browse files Browse the repository at this point in the history
Remove unneeded semicolons (empty blocks), generic type parameters (use
diamond operator), and import statements (same package).
  • Loading branch information
ctubbsii committed Jul 27, 2017
1 parent f08c58c commit f88f5cf
Show file tree
Hide file tree
Showing 24 changed files with 26 additions and 30 deletions.
Expand Up @@ -145,7 +145,7 @@ public static ClientProperty getPropertyByKey(String key) {
return prop;
return null;
}
};
}

public ClientConfiguration(String configFile) throws ConfigurationException {
this(new PropertiesConfiguration(), configFile);
Expand Down
Expand Up @@ -45,7 +45,7 @@ public static enum CompactionType {
* compaction that merges all of a tablets files into one file
*/
FULL
};
}

public static enum CompactionReason {
/**
Expand All @@ -68,7 +68,7 @@ public static enum CompactionReason {
* Compaction initiated to close a unload a tablet
*/
CLOSE
};
}

/**
*
Expand Down
Expand Up @@ -161,7 +161,6 @@ public ScanState(ClientContext context, Text tableId, Authorizations authorizati
public ScanState(ClientContext context, Text tableId, Authorizations authorizations, Range range, SortedSet<Column> fetchedColumns, int size,
List<IterInfo> serverSideIteratorList, Map<String,Map<String,String>> serverSideIteratorOptions, boolean isolated, long readaheadThreshold) {
this.context = context;
;
this.authorizations = authorizations;

columns = new ArrayList<>(fetchedColumns.size());
Expand Down Expand Up @@ -423,7 +422,7 @@ private static List<KeyValue> scan(TabletLocation loc, ScanState scanState, Clie
client.closeScan(tinfo, is.scanID);

} else {
// log.debug("Calling continue scan : "+scanState.range+" loc = "+loc);
// log.debug("Calling continue scan : "+scanState.range+" loc = "+loc);
String msg = "Continuing scan tserver=" + loc.tablet_location + " scanid=" + scanState.scanID;
Thread.currentThread().setName(msg);
opTimer.start(msg);
Expand Down
Expand Up @@ -81,7 +81,7 @@ public int compareTo(Key o) {
}
return 0;
}
};
}

final SortedMap<Key,Value> table = new ConcurrentSkipListMap<>();
int mutationCount = 0;
Expand Down
Expand Up @@ -74,7 +74,7 @@ public class Mutation implements Writable {
*/
public static enum SERIALIZED_FORMAT {
VERSION1, VERSION2
};
}

private boolean useOldDeserialize = false;
private byte[] row;
Expand Down
Expand Up @@ -44,7 +44,7 @@ static enum BlockPriority {
* Block from in-memory store
*/
MEMORY
};
}

private final String blockName;
private final byte buf[];
Expand Down
Expand Up @@ -48,7 +48,7 @@

public class CachableBlockFile {

private CachableBlockFile() {};
private CachableBlockFile() {}

private static final Logger log = LoggerFactory.getLogger(CachableBlockFile.class);

Expand Down
Expand Up @@ -112,7 +112,7 @@ private static class SecretKeyCache {
private byte[] keyEncryptionKey;
private String pathToKeyName;

public SecretKeyCache() {};
public SecretKeyCache() {}

public synchronized void ensureSecretKeyCacheInitialized(CryptoModuleParameters context) throws IOException {

Expand Down
Expand Up @@ -51,7 +51,7 @@ public static class MergeException extends Exception {
MergeException(Exception ex) {
super(ex);
}
};
}

private static final Logger log = LoggerFactory.getLogger(Merge.class);

Expand Down
Expand Up @@ -47,7 +47,7 @@ Column newColumn(String cf, String cq) {
}

public void test1() {
TreeMap<Key,Value> data = new TreeMap<Key,Value>();
TreeMap<Key,Value> data = new TreeMap<>();
data.put(newKey("r1", "cf1", "cq1"), new Value());
data.put(newKey("r1", "cf2", "cq1"), new Value());

Expand All @@ -62,7 +62,7 @@ public void test1() {

public void test2() throws Exception {

TreeMap<Key,Value> data = new TreeMap<Key,Value>();
TreeMap<Key,Value> data = new TreeMap<>();
data.put(newKey("r1", "cf1", "cq1"), new Value());
data.put(newKey("r1", "cf2", "cq1"), new Value());
data.put(newKey("r1", "cf2", "cq2"), new Value());
Expand All @@ -86,7 +86,7 @@ public void test2() throws Exception {

public void test3() throws Exception {

TreeMap<Key,Value> data = new TreeMap<Key,Value>();
TreeMap<Key,Value> data = new TreeMap<>();
data.put(newKey("r1", "cf1", "cq1"), new Value());
data.put(newKey("r1", "cf2", "cq1"), new Value());
data.put(newKey("r1", "cf2", "cq2"), new Value());
Expand Down
Expand Up @@ -37,7 +37,7 @@ public class DistributedReadWriteLock implements java.util.concurrent.locks.Read

static enum LockType {
READ, WRITE,
};
}

// serializer for lock type and user data
static class ParsedLock {
Expand Down
Expand Up @@ -124,7 +124,7 @@ public Object call() throws Exception {
});
Assert.fail("work against stopped transaction should fail");
} catch (Exception ex) {
;

}
final long txid2 = 9;
sa.start(txType, txid2);
Expand Down
Expand Up @@ -205,7 +205,7 @@ static class TServerInfo {
this.connection = connection;
this.instance = instance;
}
};
}

// The set of active tservers with locks, indexed by their name in zookeeper
private Map<String,TServerInfo> current = new HashMap<>();
Expand Down
Expand Up @@ -259,7 +259,6 @@ private void parseOnelineConfiguration(String userConfigString, String hostConfi
* @param configProperties
* The relevant configuration properties for impersonation.
*/
@SuppressWarnings("javadoc")
private void parseMultiPropertyConfiguration(Map<String,String> configProperties) {
@SuppressWarnings("deprecation")
final String configKey = Property.INSTANCE_RPC_SASL_PROXYUSERS.getKey();
Expand Down
Expand Up @@ -22,7 +22,6 @@
import java.util.Set;

import org.apache.accumulo.core.trace.wrappers.RpcServerInvocationHandler;
import org.apache.accumulo.server.rpc.RpcWrapper;
import org.apache.thrift.ProcessFunction;
import org.apache.thrift.TBase;
import org.apache.thrift.TException;
Expand Down Expand Up @@ -196,7 +195,7 @@ public int bar() {
public long barfoo() {
return 0;
}
};
}

/**
* A fake ProcessFunction implementation for testing that allows injection of method name and oneway.
Expand Down
Expand Up @@ -719,7 +719,7 @@ public void clearMigrations(String tableId) {

static enum TabletGoalState {
HOSTED, UNASSIGNED, DELETED
};
}

TabletGoalState getSystemGoalState(TabletLocationState tls) {
switch (getMasterState()) {
Expand Down
Expand Up @@ -59,7 +59,7 @@ Node find(String name) {
return node;
return null;
}
};
}

static class FakeZooStore implements DistributedStore {

Expand Down
Expand Up @@ -69,7 +69,7 @@ public SortedLogRecovery(VolumeManager fs) {

private enum Status {
INITIAL, LOOKING_FOR_FINISH, COMPLETE
};
}

private static class LastStartToFinish {
long lastStart = -1;
Expand Down
Expand Up @@ -205,7 +205,7 @@ private static class CompactionWaitInfo {

static enum CompactionState {
WAITING_TO_START, IN_PROGRESS
};
}

private volatile CompactionState minorCompactionState = null;
private volatile CompactionState majorCompactionState = null;
Expand Down
4 changes: 2 additions & 2 deletions shell/src/main/java/org/apache/accumulo/shell/Shell.java
Expand Up @@ -1021,7 +1021,7 @@ public void print(String s) {

@Override
public void close() {}
};
}

public static class PrintFile implements PrintLine {
PrintWriter writer;
Expand All @@ -1039,7 +1039,7 @@ public void print(String s) {
public void close() {
writer.close();
}
};
}

public final void printLines(Iterator<String> lines, boolean paginate) throws IOException {
printLines(lines, paginate, null);
Expand Down
Expand Up @@ -104,7 +104,7 @@ public String convert(String value) {
String process(String value) {
return value;
}
};
}

@Override
public String convert(String value) {
Expand Down
Expand Up @@ -70,7 +70,7 @@ public int read() throws IOException {
public void set(String in) {
bais = new ByteArrayInputStream(in.getBytes(UTF_8));
}
};
}

@Before
public void setUp() throws IOException, MutationsRejectedException {
Expand Down
Expand Up @@ -50,7 +50,6 @@ public void test() throws Exception {
final Connector c = getConnector();
log.info("Creating table " + tableName);
c.tableOperations().create(tableName);
;
final SortedSet<Text> splits = new TreeSet<>();
for (String split : "a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z".split(",")) {
splits.add(new Text(split));
Expand Down
Expand Up @@ -211,7 +211,7 @@ private static FateStatus getFateStatus(Instance instance, AccumuloCluster clust
AdminUtil<String> admin = new AdminUtil<>(false);
String secret = cluster.getSiteConfiguration().get(Property.INSTANCE_SECRET);
IZooReaderWriter zk = new ZooReaderWriterFactory().getZooReaderWriter(instance.getZooKeepers(), instance.getZooKeepersSessionTimeOut(), secret);
ZooStore<String> zs = new ZooStore<String>(ZooUtil.getRoot(instance) + Constants.ZFATE, zk);
ZooStore<String> zs = new ZooStore<>(ZooUtil.getRoot(instance) + Constants.ZFATE, zk);
FateStatus fateStatus = admin.getStatus(zs, zk, ZooUtil.getRoot(instance) + Constants.ZTABLE_LOCKS, null, null);
return fateStatus;
} catch (KeeperException | InterruptedException e) {
Expand Down

0 comments on commit f88f5cf

Please sign in to comment.