You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by ct...@apache.org on 2015/01/09 03:44:16 UTC
[12/66] [abbrv] accumulo git commit: ACCUMULO-3451 Format master
branch (1.7.0-SNAPSHOT)
http://git-wip-us.apache.org/repos/asf/accumulo/blob/6bc67602/server/tserver/src/main/java/org/apache/accumulo/tserver/scan/LookupTask.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/scan/LookupTask.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/scan/LookupTask.java
index 184dc4e..cb341bb 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/scan/LookupTask.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/scan/LookupTask.java
@@ -48,7 +48,7 @@ import org.apache.log4j.Logger;
public class LookupTask extends ScanTask<MultiScanResult> {
private static final Logger log = Logger.getLogger(LookupTask.class);
-
+
private final long scanID;
public LookupTask(TabletServer server, long scanID) {
@@ -109,8 +109,8 @@ public class LookupTask extends ScanTask<MultiScanResult> {
if (isCancelled())
interruptFlag.set(true);
- lookupResult = tablet.lookup(entry.getValue(), session.columnSet, session.auths, results, maxResultsSize - bytesAdded, session.ssiList,
- session.ssio, interruptFlag);
+ lookupResult = tablet.lookup(entry.getValue(), session.columnSet, session.auths, results, maxResultsSize - bytesAdded, session.ssiList, session.ssio,
+ interruptFlag);
// if the tablet was closed it it possible that the
// interrupt flag was set.... do not want it set for
@@ -170,4 +170,4 @@ public class LookupTask extends ScanTask<MultiScanResult> {
runState.set(ScanRunState.FINISHED);
}
}
-}
\ No newline at end of file
+}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/6bc67602/server/tserver/src/main/java/org/apache/accumulo/tserver/scan/NextBatchTask.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/scan/NextBatchTask.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/scan/NextBatchTask.java
index da11f14..22ea384 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/scan/NextBatchTask.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/scan/NextBatchTask.java
@@ -30,7 +30,7 @@ import org.apache.log4j.Logger;
public class NextBatchTask extends ScanTask<ScanBatch> {
private static final Logger log = Logger.getLogger(TabletServer.class);
-
+
private final long scanID;
public NextBatchTask(TabletServer server, long scanID, AtomicBoolean interruptFlag) {
@@ -93,4 +93,4 @@ public class NextBatchTask extends ScanTask<ScanBatch> {
}
}
-}
\ No newline at end of file
+}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/6bc67602/server/tserver/src/main/java/org/apache/accumulo/tserver/scan/ScanRunState.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/scan/ScanRunState.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/scan/ScanRunState.java
index f2b804c..f5a699b 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/scan/ScanRunState.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/scan/ScanRunState.java
@@ -18,4 +18,4 @@ package org.apache.accumulo.tserver.scan;
public enum ScanRunState {
QUEUED, RUNNING, FINISHED
-}
\ No newline at end of file
+}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/6bc67602/server/tserver/src/main/java/org/apache/accumulo/tserver/scan/ScanTask.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/scan/ScanTask.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/scan/ScanTask.java
index a647c84..dffdf76 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/scan/ScanTask.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/scan/ScanTask.java
@@ -126,4 +126,4 @@ public abstract class ScanTask<T> implements RunnableFuture<T> {
return runState.get();
}
-}
\ No newline at end of file
+}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/6bc67602/server/tserver/src/main/java/org/apache/accumulo/tserver/session/ConditionalSession.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/session/ConditionalSession.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/session/ConditionalSession.java
index d2515e6..cd5e617 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/session/ConditionalSession.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/session/ConditionalSession.java
@@ -18,9 +18,9 @@ package org.apache.accumulo.tserver.session;
import java.util.concurrent.atomic.AtomicBoolean;
+import org.apache.accumulo.core.client.Durability;
import org.apache.accumulo.core.security.Authorizations;
import org.apache.accumulo.core.security.thrift.TCredentials;
-import org.apache.accumulo.core.client.Durability;
public class ConditionalSession extends Session {
public final TCredentials credentials;
@@ -28,7 +28,7 @@ public class ConditionalSession extends Session {
public final String tableId;
public final AtomicBoolean interruptFlag = new AtomicBoolean();
public final Durability durability;
-
+
public ConditionalSession(TCredentials credentials, Authorizations authorizations, String tableId, Durability durability) {
super(credentials);
this.credentials = credentials;
@@ -41,4 +41,4 @@ public class ConditionalSession extends Session {
public void cleanup() {
interruptFlag.set(true);
}
-}
\ No newline at end of file
+}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/6bc67602/server/tserver/src/main/java/org/apache/accumulo/tserver/session/MultiScanSession.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/session/MultiScanSession.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/session/MultiScanSession.java
index 110fcac..b91c9e6 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/session/MultiScanSession.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/session/MultiScanSession.java
@@ -45,7 +45,8 @@ public class MultiScanSession extends Session {
public volatile ScanTask<MultiScanResult> lookupTask;
- public MultiScanSession(TCredentials credentials, KeyExtent threadPoolExtent, Map<KeyExtent,List<Range>> queries, List<IterInfo> ssiList, Map<String,Map<String,String>> ssio, Authorizations authorizations) {
+ public MultiScanSession(TCredentials credentials, KeyExtent threadPoolExtent, Map<KeyExtent,List<Range>> queries, List<IterInfo> ssiList,
+ Map<String,Map<String,String>> ssio, Authorizations authorizations) {
super(credentials);
this.queries = queries;
this.ssiList = ssiList;
@@ -59,4 +60,4 @@ public class MultiScanSession extends Session {
if (lookupTask != null)
lookupTask.cancel(true);
}
-}
\ No newline at end of file
+}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/6bc67602/server/tserver/src/main/java/org/apache/accumulo/tserver/session/ScanSession.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/session/ScanSession.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/session/ScanSession.java
index 3f9b7af..f4d72a0 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/session/ScanSession.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/session/ScanSession.java
@@ -44,8 +44,9 @@ public class ScanSession extends Session {
public volatile ScanTask<ScanBatch> nextBatchTask;
public Scanner scanner;
public final long readaheadThreshold;
-
- public ScanSession(TCredentials credentials, KeyExtent extent, Set<Column> columnSet, List<IterInfo> ssiList, Map<String,Map<String,String>> ssio, Authorizations authorizations, long readaheadThreshold) {
+
+ public ScanSession(TCredentials credentials, KeyExtent extent, Set<Column> columnSet, List<IterInfo> ssiList, Map<String,Map<String,String>> ssio,
+ Authorizations authorizations, long readaheadThreshold) {
super(credentials);
this.extent = extent;
this.columnSet = columnSet;
@@ -66,4 +67,4 @@ public class ScanSession extends Session {
}
}
-}
\ No newline at end of file
+}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/6bc67602/server/tserver/src/main/java/org/apache/accumulo/tserver/session/Session.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/session/Session.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/session/Session.java
index dfe38e4..9aaa17a 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/session/Session.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/session/Session.java
@@ -25,19 +25,19 @@ public class Session {
public long startTime;
public boolean reserved;
private final TCredentials credentials;
-
+
public Session(TCredentials credentials) {
this.credentials = credentials;
this.client = TServerUtils.clientAddress.get();
}
-
+
public String getUser() {
return credentials.getPrincipal();
}
-
+
public TCredentials getCredentials() {
return credentials;
}
public void cleanup() {}
-}
\ No newline at end of file
+}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/6bc67602/server/tserver/src/main/java/org/apache/accumulo/tserver/session/SessionManager.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/session/SessionManager.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/session/SessionManager.java
index 13049e2..51722d9 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/session/SessionManager.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/session/SessionManager.java
@@ -276,8 +276,9 @@ public class SessionManager {
}
}
- ActiveScan activeScan = new ActiveScan(ss.client, ss.getUser(), ss.extent.getTableId().toString(), ct - ss.startTime, ct - ss.lastAccessTime, ScanType.SINGLE,
- state, ss.extent.toThrift(), Translator.translate(ss.columnSet, Translators.CT), ss.ssiList, ss.ssio, ss.auths.getAuthorizationsBB());
+ ActiveScan activeScan = new ActiveScan(ss.client, ss.getUser(), ss.extent.getTableId().toString(), ct - ss.startTime, ct - ss.lastAccessTime,
+ ScanType.SINGLE, state, ss.extent.toThrift(), Translator.translate(ss.columnSet, Translators.CT), ss.ssiList, ss.ssio,
+ ss.auths.getAuthorizationsBB());
// scanId added by ACCUMULO-2641 is an optional thrift argument and not available in ActiveScan constructor
activeScan.setScanId(entry.getKey());
http://git-wip-us.apache.org/repos/asf/accumulo/blob/6bc67602/server/tserver/src/main/java/org/apache/accumulo/tserver/session/UpdateSession.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/session/UpdateSession.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/session/UpdateSession.java
index 65430ce..08930ac 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/session/UpdateSession.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/session/UpdateSession.java
@@ -20,6 +20,7 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
+import org.apache.accumulo.core.client.Durability;
import org.apache.accumulo.core.client.impl.thrift.SecurityErrorCode;
import org.apache.accumulo.core.constraints.Violations;
import org.apache.accumulo.core.data.KeyExtent;
@@ -28,7 +29,6 @@ import org.apache.accumulo.core.security.thrift.TCredentials;
import org.apache.accumulo.core.util.MapCounter;
import org.apache.accumulo.core.util.Stat;
import org.apache.accumulo.tserver.TservConstraintEnv;
-import org.apache.accumulo.core.client.Durability;
import org.apache.accumulo.tserver.tablet.Tablet;
public class UpdateSession extends Session {
@@ -42,17 +42,17 @@ public class UpdateSession extends Session {
public final Stat authTimes = new Stat();
public final Map<Tablet,List<Mutation>> queuedMutations = new HashMap<Tablet,List<Mutation>>();
public final Violations violations;
-
+
public Tablet currentTablet = null;
public long totalUpdates = 0;
public long flushTime = 0;
public long queuedMutationSize = 0;
public final Durability durability;
-
+
public UpdateSession(TservConstraintEnv env, TCredentials credentials, Durability durability) {
super(credentials);
this.cenv = env;
this.violations = new Violations();
this.durability = durability;
}
-}
\ No newline at end of file
+}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/6bc67602/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Batch.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Batch.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Batch.java
index 1a83ba4..4388867 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Batch.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Batch.java
@@ -25,7 +25,7 @@ final class Batch {
private final List<KVEntry> results;
private final Key continueKey;
private final long numBytes;
-
+
Batch(boolean skipContinueKey, List<KVEntry> results, Key continueKey, long numBytes) {
this.skipContinueKey = skipContinueKey;
this.results = results;
@@ -48,4 +48,4 @@ final class Batch {
public long getNumBytes() {
return numBytes;
}
-}
\ No newline at end of file
+}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/6bc67602/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/CommitSession.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/CommitSession.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/CommitSession.java
index db4100f..17290c0 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/CommitSession.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/CommitSession.java
@@ -26,7 +26,7 @@ import org.apache.accumulo.tserver.log.DfsLogger;
import org.apache.log4j.Logger;
public class CommitSession {
-
+
private static final Logger log = Logger.getLogger(CommitSession.class);
private final int seq;
@@ -114,4 +114,4 @@ public class CommitSession {
public void mutate(List<Mutation> mutations) {
memTable.mutate(mutations);
}
-}
\ No newline at end of file
+}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/6bc67602/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/CompactionInfo.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/CompactionInfo.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/CompactionInfo.java
index 8e9fb9b..918edf6 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/CompactionInfo.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/CompactionInfo.java
@@ -123,7 +123,7 @@ public class CompactionInfo {
List<String> filesToCompact = new ArrayList<String>();
for (FileRef ref : compactor.getFilesToCompact())
filesToCompact.add(ref.toString());
- return new ActiveCompaction(compactor.extent.toThrift(), System.currentTimeMillis() - compactor.getStartTime(), filesToCompact,
- compactor.getOutputFile(), type, reason, localityGroup, entriesRead, entriesWritten, iiList, iterOptions);
+ return new ActiveCompaction(compactor.extent.toThrift(), System.currentTimeMillis() - compactor.getStartTime(), filesToCompact, compactor.getOutputFile(),
+ type, reason, localityGroup, entriesRead, entriesWritten, iiList, iterOptions);
}
-}
\ No newline at end of file
+}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/6bc67602/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/CompactionRunner.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/CompactionRunner.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/CompactionRunner.java
index 1dee64b..53cc750 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/CompactionRunner.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/CompactionRunner.java
@@ -73,4 +73,4 @@ final class CompactionRunner implements Runnable, Comparable<CompactionRunner> {
return o.getNumFiles() - this.getNumFiles();
}
-}
\ No newline at end of file
+}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/6bc67602/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/CompactionStats.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/CompactionStats.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/CompactionStats.java
index 69832e9..68a2307 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/CompactionStats.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/CompactionStats.java
@@ -20,39 +20,39 @@ public class CompactionStats {
private long entriesRead;
private long entriesWritten;
private long fileSize;
-
+
CompactionStats(long er, long ew) {
this.setEntriesRead(er);
this.setEntriesWritten(ew);
}
-
+
public CompactionStats() {}
-
+
private void setEntriesRead(long entriesRead) {
this.entriesRead = entriesRead;
}
-
+
public long getEntriesRead() {
return entriesRead;
}
-
+
private void setEntriesWritten(long entriesWritten) {
this.entriesWritten = entriesWritten;
}
-
+
public long getEntriesWritten() {
return entriesWritten;
}
-
+
public void add(CompactionStats mcs) {
this.entriesRead += mcs.entriesRead;
this.entriesWritten += mcs.entriesWritten;
}
-
+
public void setFileSize(long fileSize) {
this.fileSize = fileSize;
}
-
+
public long getFileSize() {
return this.fileSize;
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/6bc67602/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/CompactionWatcher.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/CompactionWatcher.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/CompactionWatcher.java
index adc01b2..94fbfdc 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/CompactionWatcher.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/CompactionWatcher.java
@@ -29,18 +29,18 @@ import org.apache.accumulo.server.util.time.SimpleTimer;
import org.apache.log4j.Logger;
/**
- *
+ *
*/
public class CompactionWatcher implements Runnable {
private final Map<List<Long>,ObservedCompactionInfo> observedCompactions = new HashMap<List<Long>,ObservedCompactionInfo>();
private final AccumuloConfiguration config;
private static boolean watching = false;
-
+
private static class ObservedCompactionInfo {
CompactionInfo compactionInfo;
long firstSeen;
boolean loggedWarning;
-
+
ObservedCompactionInfo(CompactionInfo ci, long time) {
this.compactionInfo = ci;
this.firstSeen = time;
@@ -54,24 +54,24 @@ public class CompactionWatcher implements Runnable {
@Override
public void run() {
List<CompactionInfo> runningCompactions = Compactor.getRunningCompactions();
-
+
Set<List<Long>> newKeys = new HashSet<List<Long>>();
-
+
long time = System.currentTimeMillis();
for (CompactionInfo ci : runningCompactions) {
List<Long> compactionKey = Arrays.asList(ci.getID(), ci.getEntriesRead(), ci.getEntriesWritten());
newKeys.add(compactionKey);
-
+
if (!observedCompactions.containsKey(compactionKey)) {
observedCompactions.put(compactionKey, new ObservedCompactionInfo(ci, time));
}
}
-
+
// look for compactions that finished or made progress and logged a warning
HashMap<List<Long>,ObservedCompactionInfo> copy = new HashMap<List<Long>,ObservedCompactionInfo>(observedCompactions);
copy.keySet().removeAll(newKeys);
-
+
for (ObservedCompactionInfo oci : copy.values()) {
if (oci.loggedWarning) {
Logger.getLogger(CompactionWatcher.class).info("Compaction of " + oci.compactionInfo.getExtent() + " is no longer stuck");
@@ -80,7 +80,7 @@ public class CompactionWatcher implements Runnable {
// remove any compaction that completed or made progress
observedCompactions.keySet().retainAll(newKeys);
-
+
long warnTime = config.getTimeInMillis(Property.TSERV_COMPACTION_WARN_TIME);
// check for stuck compactions
http://git-wip-us.apache.org/repos/asf/accumulo/blob/6bc67602/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Compactor.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Compactor.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Compactor.java
index 869cc33..1c23293 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Compactor.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Compactor.java
@@ -75,7 +75,7 @@ public class Compactor implements Callable<CompactionStats> {
}
public interface CompactionEnv {
-
+
boolean isCompactionEnabled();
IteratorScope getIteratorScope();
@@ -113,7 +113,7 @@ public class Compactor implements Callable<CompactionStats> {
private synchronized void setLocalityGroup(String name) {
this.currentLocalityGroup = name;
}
-
+
public synchronized String getCurrentLocalityGroup() {
return currentLocalityGroup;
}
@@ -411,7 +411,7 @@ public class Compactor implements Callable<CompactionStats> {
long getEntriesRead() {
return entriesRead.get();
}
-
+
long getEntriesWritten() {
return entriesWritten.get();
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/6bc67602/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/CountingIterator.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/CountingIterator.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/CountingIterator.java
index 44b8460..8716695 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/CountingIterator.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/CountingIterator.java
@@ -75,4 +75,4 @@ public class CountingIterator extends WrappingIterator {
return count + sum;
}
-}
\ No newline at end of file
+}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/6bc67602/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/KVEntry.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/KVEntry.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/KVEntry.java
index 4919be9..4b1cf8c 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/KVEntry.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/KVEntry.java
@@ -36,4 +36,4 @@ public class KVEntry extends KeyValue {
int estimateMemoryUsed() {
return getKey().getSize() + getValue().get().length + (9 * 32); // overhead is 32 per object
}
-}
\ No newline at end of file
+}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/6bc67602/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/MinorCompactionTask.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/MinorCompactionTask.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/MinorCompactionTask.java
index c5dd4a4..8609a4b 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/MinorCompactionTask.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/MinorCompactionTask.java
@@ -76,8 +76,8 @@ class MinorCompactionTask implements Runnable {
}
span.stop();
span = Trace.start("compact");
- this.stats = tablet.minorCompact(tablet.getTabletServer().getFileSystem(), tablet.getTabletMemory().getMinCMemTable(), tmpFileRef, newMapfileLocation, mergeFile, true, queued, commitSession, flushId,
- mincReason);
+ this.stats = tablet.minorCompact(tablet.getTabletServer().getFileSystem(), tablet.getTabletMemory().getMinCMemTable(), tmpFileRef, newMapfileLocation,
+ mergeFile, true, queued, commitSession, flushId, mincReason);
span.stop();
if (tablet.needsSplit()) {
@@ -96,4 +96,4 @@ class MinorCompactionTask implements Runnable {
minorCompaction.stop();
}
}
-}
\ No newline at end of file
+}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/6bc67602/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/MinorCompactor.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/MinorCompactor.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/MinorCompactor.java
index b513167..a425aa1 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/MinorCompactor.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/MinorCompactor.java
@@ -39,37 +39,37 @@ import org.apache.hadoop.fs.Path;
import org.apache.log4j.Logger;
public class MinorCompactor extends Compactor {
-
+
private static final Logger log = Logger.getLogger(MinorCompactor.class);
-
+
private static final Map<FileRef,DataFileValue> EMPTY_MAP = Collections.emptyMap();
-
+
private static Map<FileRef,DataFileValue> toFileMap(FileRef mergeFile, DataFileValue dfv) {
if (mergeFile == null)
return EMPTY_MAP;
-
+
return Collections.singletonMap(mergeFile, dfv);
}
-
+
private final TabletServer tabletServer;
public MinorCompactor(TabletServer tabletServer, Tablet tablet, InMemoryMap imm, FileRef mergeFile, DataFileValue dfv, FileRef outputFile,
MinorCompactionReason mincReason, TableConfiguration tableConfig) {
super(tabletServer, tablet, toFileMap(mergeFile, dfv), imm, outputFile, true, new CompactionEnv() {
-
+
@Override
public boolean isCompactionEnabled() {
return true;
}
-
+
@Override
public IteratorScope getIteratorScope() {
return IteratorScope.minc;
}
- }, Collections.<IteratorSetting>emptyList(), mincReason.ordinal(), tableConfig);
+ }, Collections.<IteratorSetting> emptyList(), mincReason.ordinal(), tableConfig);
this.tabletServer = tabletServer;
}
-
+
private boolean isTableDeleting() {
try {
return Tables.getTableState(tabletServer.getInstance(), extent.getTableId().toString()) == TableState.DELETING;
@@ -78,30 +78,30 @@ public class MinorCompactor extends Compactor {
return false; // can not get positive confirmation that its deleting.
}
}
-
+
@Override
public CompactionStats call() {
log.debug("Begin minor compaction " + getOutputFile() + " " + getExtent());
-
+
// output to new MapFile with a temporary name
int sleepTime = 100;
double growthFactor = 4;
int maxSleepTime = 1000 * 60 * 3; // 3 minutes
boolean reportedProblem = false;
-
+
runningCompactions.add(this);
try {
do {
try {
CompactionStats ret = super.call();
-
+
// log.debug(String.format("MinC %,d recs in | %,d recs out | %,d recs/sec | %6.3f secs | %,d bytes ",map.size(), entriesCompacted,
// (int)(map.size()/((t2 - t1)/1000.0)), (t2 - t1)/1000.0, estimatedSizeInBytes()));
-
+
if (reportedProblem) {
ProblemReports.getInstance(tabletServer).deleteProblemReport(getExtent().getTableId().toString(), ProblemType.FILE_WRITE, getOutputFile());
}
-
+
return ret;
} catch (IOException e) {
log.warn("MinC failed (" + e.getMessage() + ") to create " + getOutputFile() + " retrying ...");
@@ -116,14 +116,14 @@ public class MinorCompactor extends Compactor {
} catch (CompactionCanceledException e) {
throw new IllegalStateException(e);
}
-
+
Random random = new Random();
-
+
int sleep = sleepTime + random.nextInt(sleepTime);
log.debug("MinC failed sleeping " + sleep + " ms before retrying");
UtilWaitThread.sleep(sleep);
sleepTime = (int) Math.round(Math.min(maxSleepTime, sleepTime * growthFactor));
-
+
// clean up
try {
if (getFileSystem().exists(new Path(getOutputFile()))) {
@@ -132,15 +132,15 @@ public class MinorCompactor extends Compactor {
} catch (IOException e) {
log.warn("Failed to delete failed MinC file " + getOutputFile() + " " + e.getMessage());
}
-
+
if (isTableDeleting())
return new CompactionStats(0, 0);
-
+
} while (true);
} finally {
thread = null;
runningCompactions.remove(this);
}
}
-
+
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/6bc67602/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Rate.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Rate.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Rate.java
index 450fffe..a0ea2d6 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Rate.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Rate.java
@@ -21,10 +21,10 @@ public class Rate {
private long lastTime = -1;
private double current = 0.0;
final double ratio;
-
+
/**
* Turn a counter into an exponentially smoothed rate over time.
- *
+ *
* @param ratio
* the rate at which each update influences the curve; must be (0., 1.0)
*/
@@ -33,11 +33,11 @@ public class Rate {
throw new IllegalArgumentException("ratio must be > 0. and < 1.0");
this.ratio = ratio;
}
-
+
public double update(long counter) {
return update(System.currentTimeMillis(), counter);
}
-
+
synchronized public double update(long when, long counter) {
if (lastCounter < 0) {
lastTime = when;
@@ -53,7 +53,7 @@ public class Rate {
lastCounter = counter;
return current;
}
-
+
synchronized public double rate() {
return this.current;
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/6bc67602/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/RootFiles.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/RootFiles.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/RootFiles.java
index 875643e..d0278f4 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/RootFiles.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/RootFiles.java
@@ -32,7 +32,7 @@ import org.apache.hadoop.fs.Path;
import org.apache.log4j.Logger;
/**
- *
+ *
*/
public class RootFiles {
http://git-wip-us.apache.org/repos/asf/accumulo/blob/6bc67602/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/ScanBatch.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/ScanBatch.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/ScanBatch.java
index dc932c6..888d6f5 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/ScanBatch.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/ScanBatch.java
@@ -34,4 +34,4 @@ final public class ScanBatch {
public List<KVEntry> getResults() {
return results;
}
-}
\ No newline at end of file
+}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/6bc67602/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/ScanDataSource.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/ScanDataSource.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/ScanDataSource.java
index fe4b16b..00333c6 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/ScanDataSource.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/ScanDataSource.java
@@ -64,8 +64,8 @@ class ScanDataSource implements DataSource {
private final ScanOptions options;
- ScanDataSource(Tablet tablet, Authorizations authorizations, byte[] defaultLabels, HashSet<Column> columnSet, List<IterInfo> ssiList, Map<String,Map<String,String>> ssio,
- AtomicBoolean interruptFlag) {
+ ScanDataSource(Tablet tablet, Authorizations authorizations, byte[] defaultLabels, HashSet<Column> columnSet, List<IterInfo> ssiList,
+ Map<String,Map<String,String>> ssio, AtomicBoolean interruptFlag) {
this.tablet = tablet;
expectedDeletionCount = tablet.getDataSourceDeletions();
this.options = new ScanOptions(-1, authorizations, defaultLabels, columnSet, ssiList, ssio, interruptFlag, false);
@@ -171,8 +171,8 @@ class ScanDataSource implements DataSource {
VisibilityFilter visFilter = new VisibilityFilter(colFilter, options.getAuthorizations(), options.getDefaultLabels());
- return iterEnv.getTopLevelIterator(IteratorUtil
- .loadIterators(IteratorScope.scan, visFilter, tablet.getExtent(), tablet.getTableConfiguration(), options.getSsiList(), options.getSsio(), iterEnv));
+ return iterEnv.getTopLevelIterator(IteratorUtil.loadIterators(IteratorScope.scan, visFilter, tablet.getExtent(), tablet.getTableConfiguration(),
+ options.getSsiList(), options.getSsio(), iterEnv));
}
void close(boolean sawErrors) {
@@ -213,7 +213,7 @@ class ScanDataSource implements DataSource {
if (fileManager != null)
fileManager.reattach();
}
-
+
public void detachFileManager() {
if (fileManager != null)
fileManager.detach();
http://git-wip-us.apache.org/repos/asf/accumulo/blob/6bc67602/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/ScanOptions.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/ScanOptions.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/ScanOptions.java
index 07aa8e7..93e8eee 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/ScanOptions.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/ScanOptions.java
@@ -36,8 +36,8 @@ final class ScanOptions {
private final int num;
private final boolean isolated;
- ScanOptions(int num, Authorizations authorizations, byte[] defaultLabels, Set<Column> columnSet, List<IterInfo> ssiList,
- Map<String,Map<String,String>> ssio, AtomicBoolean interruptFlag, boolean isolated) {
+ ScanOptions(int num, Authorizations authorizations, byte[] defaultLabels, Set<Column> columnSet, List<IterInfo> ssiList, Map<String,Map<String,String>> ssio,
+ AtomicBoolean interruptFlag, boolean isolated) {
this.num = num;
this.authorizations = authorizations;
this.defaultLabels = defaultLabels;
@@ -79,4 +79,4 @@ final class ScanOptions {
public boolean isIsolated() {
return isolated;
}
-}
\ No newline at end of file
+}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/6bc67602/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Scanner.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Scanner.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Scanner.java
index ad3fcb2..17ae729 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Scanner.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Scanner.java
@@ -113,10 +113,10 @@ public class Scanner {
// to return mapfiles, even when exception is thrown
if (!options.isIsolated()) {
dataSource.close(false);
- } else {
+ } else {
dataSource.detachFileManager();
}
-
+
if (results != null && results.getResults() != null)
tablet.updateQueryStats(results.getResults().size(), results.getNumBytes());
}
@@ -133,4 +133,4 @@ public class Scanner {
isolatedDataSource.close(false);
}
}
-}
\ No newline at end of file
+}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/6bc67602/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/SplitInfo.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/SplitInfo.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/SplitInfo.java
index ec84aa8..f8f2183 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/SplitInfo.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/SplitInfo.java
@@ -24,12 +24,12 @@ import org.apache.accumulo.server.master.state.TServerInstance;
/**
* operations are disallowed while we split which is ok since splitting is fast
- *
+ *
* a minor compaction should have taken place before calling this so there should be relatively little left to compact
- *
+ *
* we just need to make sure major compactions aren't occurring if we have the major compactor thread decide who needs splitting we can avoid synchronization
* issues with major compactions
- *
+ *
*/
final public class SplitInfo {
@@ -73,4 +73,4 @@ final public class SplitInfo {
return lastLocation;
}
-}
\ No newline at end of file
+}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/6bc67602/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/SplitRowSpec.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/SplitRowSpec.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/SplitRowSpec.java
index 75cf91e..367902f 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/SplitRowSpec.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/SplitRowSpec.java
@@ -26,4 +26,4 @@ class SplitRowSpec {
this.splitRatio = splitRatio;
this.row = row;
}
-}
\ No newline at end of file
+}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/6bc67602/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Tablet.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Tablet.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Tablet.java
index 7279953..17c60ec 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Tablet.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Tablet.java
@@ -1786,7 +1786,7 @@ public class Tablet implements TabletCommitter {
CompactionStrategy strategy = null;
Map<FileRef,Pair<Key,Key>> firstAndLastKeys = null;
- if(reason == MajorCompactionReason.USER){
+ if (reason == MajorCompactionReason.USER) {
try {
compactionId = getCompactionID();
strategy = createCompactionStrategy(compactionId.getSecond().getCompactionStrategy());
@@ -1887,7 +1887,7 @@ public class Tablet implements TabletCommitter {
log.debug(String.format("MajC initiate lock %.2f secs, wait %.2f secs", (t3 - t2) / 1000.0, (t2 - t1) / 1000.0));
if (updateCompactionID) {
- MetadataTableUtil.updateTabletCompactID(extent, compactionId.getFirst(),tabletServer, getTabletServer().getLock());
+ MetadataTableUtil.updateTabletCompactID(extent, compactionId.getFirst(), tabletServer, getTabletServer().getLock());
return majCStats;
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/6bc67602/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/TabletClosedException.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/TabletClosedException.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/TabletClosedException.java
index 827b803..d3ed507 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/TabletClosedException.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/TabletClosedException.java
@@ -26,4 +26,4 @@ public class TabletClosedException extends RuntimeException {
}
private static final long serialVersionUID = 1L;
-}
\ No newline at end of file
+}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/6bc67602/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/TabletCommitter.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/TabletCommitter.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/TabletCommitter.java
index 3042267..b56d0af 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/TabletCommitter.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/TabletCommitter.java
@@ -48,5 +48,5 @@ public interface TabletCommitter {
Durability getDurability();
void updateMemoryUsageStats(long estimatedSizeInBytes, long estimatedSizeInBytes2);
-
+
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/6bc67602/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/TabletMemory.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/TabletMemory.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/TabletMemory.java
index 155d6b5..15cd50d 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/TabletMemory.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/TabletMemory.java
@@ -29,7 +29,7 @@ import org.apache.log4j.Logger;
class TabletMemory implements Closeable {
static private final Logger log = Logger.getLogger(TabletMemory.class);
-
+
private final TabletCommitter tablet;
private InMemoryMap memTable;
private InMemoryMap otherMemTable;
@@ -93,7 +93,7 @@ class TabletMemory implements Closeable {
if (deletingMemTable != null) {
throw new IllegalStateException();
}
-
+
if (commitSession == null) {
throw new IllegalStateException();
}
@@ -187,4 +187,4 @@ class TabletMemory implements Closeable {
public boolean isClosed() {
return commitSession == null;
}
-}
\ No newline at end of file
+}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/6bc67602/server/tserver/src/test/java/org/apache/accumulo/server/tabletserver/LargestFirstMemoryManagerTest.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/test/java/org/apache/accumulo/server/tabletserver/LargestFirstMemoryManagerTest.java b/server/tserver/src/test/java/org/apache/accumulo/server/tabletserver/LargestFirstMemoryManagerTest.java
index 2a85825..e17281a 100644
--- a/server/tserver/src/test/java/org/apache/accumulo/server/tabletserver/LargestFirstMemoryManagerTest.java
+++ b/server/tserver/src/test/java/org/apache/accumulo/server/tabletserver/LargestFirstMemoryManagerTest.java
@@ -34,12 +34,12 @@ import org.apache.hadoop.io.Text;
import org.junit.Test;
public class LargestFirstMemoryManagerTest {
-
+
private static final long ZERO = System.currentTimeMillis();
private static final long LATER = ZERO + 20 * 60 * 1000;
- private static final long ONE_GIG = 1024*1024*1024;
- private static final long HALF_GIG = ONE_GIG/2;
- private static final long QGIG = ONE_GIG/4;
+ private static final long ONE_GIG = 1024 * 1024 * 1024;
+ private static final long HALF_GIG = ONE_GIG / 2;
+ private static final long QGIG = ONE_GIG / 4;
private static final long ONE_MINUTE = 60 * 1000;
@Test
@@ -94,138 +94,72 @@ public class LargestFirstMemoryManagerTest {
// lots of work to do
mgr = new LargestFirstMemoryManagerUnderTest();
mgr.init(config);
- result = mgr.getMemoryManagementActions(tablets(
- t(k("a"), ZERO, HALF_GIG, 0),
- t(k("b"), ZERO, HALF_GIG+1, 0),
- t(k("c"), ZERO, HALF_GIG+2, 0),
- t(k("d"), ZERO, HALF_GIG+3, 0),
- t(k("e"), ZERO, HALF_GIG+4, 0),
- t(k("f"), ZERO, HALF_GIG+5, 0),
- t(k("g"), ZERO, HALF_GIG+6, 0),
- t(k("h"), ZERO, HALF_GIG+7, 0),
- t(k("i"), ZERO, HALF_GIG+8, 0))
- );
+ result = mgr.getMemoryManagementActions(tablets(t(k("a"), ZERO, HALF_GIG, 0), t(k("b"), ZERO, HALF_GIG + 1, 0), t(k("c"), ZERO, HALF_GIG + 2, 0),
+ t(k("d"), ZERO, HALF_GIG + 3, 0), t(k("e"), ZERO, HALF_GIG + 4, 0), t(k("f"), ZERO, HALF_GIG + 5, 0), t(k("g"), ZERO, HALF_GIG + 6, 0),
+ t(k("h"), ZERO, HALF_GIG + 7, 0), t(k("i"), ZERO, HALF_GIG + 8, 0)));
assertEquals(2, result.tabletsToMinorCompact.size());
assertEquals(k("i"), result.tabletsToMinorCompact.get(0));
assertEquals(k("h"), result.tabletsToMinorCompact.get(1));
// one finished, one in progress, one filled up
mgr = new LargestFirstMemoryManagerUnderTest();
mgr.init(config);
- result = mgr.getMemoryManagementActions(tablets(
- t(k("a"), ZERO, HALF_GIG, 0),
- t(k("b"), ZERO, HALF_GIG+1, 0),
- t(k("c"), ZERO, HALF_GIG+2, 0),
- t(k("d"), ZERO, HALF_GIG+3, 0),
- t(k("e"), ZERO, HALF_GIG+4, 0),
- t(k("f"), ZERO, HALF_GIG+5, 0),
- t(k("g"), ZERO, ONE_GIG, 0),
- t(k("h"), ZERO, 0, HALF_GIG+7),
- t(k("i"), ZERO, 0, 0))
- );
+ result = mgr.getMemoryManagementActions(tablets(t(k("a"), ZERO, HALF_GIG, 0), t(k("b"), ZERO, HALF_GIG + 1, 0), t(k("c"), ZERO, HALF_GIG + 2, 0),
+ t(k("d"), ZERO, HALF_GIG + 3, 0), t(k("e"), ZERO, HALF_GIG + 4, 0), t(k("f"), ZERO, HALF_GIG + 5, 0), t(k("g"), ZERO, ONE_GIG, 0),
+ t(k("h"), ZERO, 0, HALF_GIG + 7), t(k("i"), ZERO, 0, 0)));
assertEquals(1, result.tabletsToMinorCompact.size());
assertEquals(k("g"), result.tabletsToMinorCompact.get(0));
// memory is very full, lots of candidates
- result = mgr.getMemoryManagementActions(tablets(
- t(k("a"), ZERO, HALF_GIG, 0),
- t(k("b"), ZERO, ONE_GIG+1, 0),
- t(k("c"), ZERO, ONE_GIG+2, 0),
- t(k("d"), ZERO, ONE_GIG+3, 0),
- t(k("e"), ZERO, ONE_GIG+4, 0),
- t(k("f"), ZERO, ONE_GIG+5, 0),
- t(k("g"), ZERO, ONE_GIG+6, 0),
- t(k("h"), ZERO, 0, 0),
- t(k("i"), ZERO, 0, 0))
- );
+ result = mgr.getMemoryManagementActions(tablets(t(k("a"), ZERO, HALF_GIG, 0), t(k("b"), ZERO, ONE_GIG + 1, 0), t(k("c"), ZERO, ONE_GIG + 2, 0),
+ t(k("d"), ZERO, ONE_GIG + 3, 0), t(k("e"), ZERO, ONE_GIG + 4, 0), t(k("f"), ZERO, ONE_GIG + 5, 0), t(k("g"), ZERO, ONE_GIG + 6, 0),
+ t(k("h"), ZERO, 0, 0), t(k("i"), ZERO, 0, 0)));
assertEquals(2, result.tabletsToMinorCompact.size());
assertEquals(k("g"), result.tabletsToMinorCompact.get(0));
assertEquals(k("f"), result.tabletsToMinorCompact.get(1));
// only have two compactors, still busy
- result = mgr.getMemoryManagementActions(tablets(
- t(k("a"), ZERO, HALF_GIG, 0),
- t(k("b"), ZERO, ONE_GIG+1, 0),
- t(k("c"), ZERO, ONE_GIG+2, 0),
- t(k("d"), ZERO, ONE_GIG+3, 0),
- t(k("e"), ZERO, ONE_GIG+4, 0),
- t(k("f"), ZERO, ONE_GIG, ONE_GIG+5),
- t(k("g"), ZERO, ONE_GIG, ONE_GIG+6),
- t(k("h"), ZERO, 0, 0),
- t(k("i"), ZERO, 0, 0))
- );
+ result = mgr.getMemoryManagementActions(tablets(t(k("a"), ZERO, HALF_GIG, 0), t(k("b"), ZERO, ONE_GIG + 1, 0), t(k("c"), ZERO, ONE_GIG + 2, 0),
+ t(k("d"), ZERO, ONE_GIG + 3, 0), t(k("e"), ZERO, ONE_GIG + 4, 0), t(k("f"), ZERO, ONE_GIG, ONE_GIG + 5), t(k("g"), ZERO, ONE_GIG, ONE_GIG + 6),
+ t(k("h"), ZERO, 0, 0), t(k("i"), ZERO, 0, 0)));
assertEquals(0, result.tabletsToMinorCompact.size());
- // finished one
- result = mgr.getMemoryManagementActions(tablets(
- t(k("a"), ZERO, HALF_GIG, 0),
- t(k("b"), ZERO, ONE_GIG+1, 0),
- t(k("c"), ZERO, ONE_GIG+2, 0),
- t(k("d"), ZERO, ONE_GIG+3, 0),
- t(k("e"), ZERO, ONE_GIG+4, 0),
- t(k("f"), ZERO, ONE_GIG, ONE_GIG+5),
- t(k("g"), ZERO, ONE_GIG, 0),
- t(k("h"), ZERO, 0, 0),
- t(k("i"), ZERO, 0, 0))
- );
+ // finished one
+ result = mgr.getMemoryManagementActions(tablets(t(k("a"), ZERO, HALF_GIG, 0), t(k("b"), ZERO, ONE_GIG + 1, 0), t(k("c"), ZERO, ONE_GIG + 2, 0),
+ t(k("d"), ZERO, ONE_GIG + 3, 0), t(k("e"), ZERO, ONE_GIG + 4, 0), t(k("f"), ZERO, ONE_GIG, ONE_GIG + 5), t(k("g"), ZERO, ONE_GIG, 0),
+ t(k("h"), ZERO, 0, 0), t(k("i"), ZERO, 0, 0)));
assertEquals(1, result.tabletsToMinorCompact.size());
assertEquals(k("e"), result.tabletsToMinorCompact.get(0));
// many are running: do nothing
mgr = new LargestFirstMemoryManagerUnderTest();
mgr.init(config);
- result = mgr.getMemoryManagementActions(tablets(
- t(k("a"), ZERO, HALF_GIG, 0),
- t(k("b"), ZERO, HALF_GIG+1, 0),
- t(k("c"), ZERO, HALF_GIG+2, 0),
- t(k("d"), ZERO, 0, HALF_GIG),
- t(k("e"), ZERO, 0, HALF_GIG),
- t(k("f"), ZERO, 0, HALF_GIG),
- t(k("g"), ZERO, 0, HALF_GIG),
- t(k("i"), ZERO, 0, HALF_GIG),
- t(k("j"), ZERO, 0, HALF_GIG),
- t(k("k"), ZERO, 0, HALF_GIG),
- t(k("l"), ZERO, 0, HALF_GIG),
- t(k("m"), ZERO, 0, HALF_GIG)
- ));
+ result = mgr.getMemoryManagementActions(tablets(t(k("a"), ZERO, HALF_GIG, 0), t(k("b"), ZERO, HALF_GIG + 1, 0), t(k("c"), ZERO, HALF_GIG + 2, 0),
+ t(k("d"), ZERO, 0, HALF_GIG), t(k("e"), ZERO, 0, HALF_GIG), t(k("f"), ZERO, 0, HALF_GIG), t(k("g"), ZERO, 0, HALF_GIG), t(k("i"), ZERO, 0, HALF_GIG),
+ t(k("j"), ZERO, 0, HALF_GIG), t(k("k"), ZERO, 0, HALF_GIG), t(k("l"), ZERO, 0, HALF_GIG), t(k("m"), ZERO, 0, HALF_GIG)));
assertEquals(0, result.tabletsToMinorCompact.size());
-
+
// observe adjustment:
mgr = new LargestFirstMemoryManagerUnderTest();
mgr.init(config);
// compact the largest
- result = mgr.getMemoryManagementActions(tablets(
- t(k("a"), ZERO, QGIG, 0),
- t(k("b"), ZERO, QGIG+1, 0),
- t(k("c"), ZERO, QGIG+2, 0)));
+ result = mgr.getMemoryManagementActions(tablets(t(k("a"), ZERO, QGIG, 0), t(k("b"), ZERO, QGIG + 1, 0), t(k("c"), ZERO, QGIG + 2, 0)));
assertEquals(1, result.tabletsToMinorCompact.size());
assertEquals(k("c"), result.tabletsToMinorCompact.get(0));
// show that it is compacting... do nothing
- result = mgr.getMemoryManagementActions(tablets(
- t(k("a"), ZERO, QGIG, 0),
- t(k("b"), ZERO, QGIG+1, 0),
- t(k("c"), ZERO, 0, QGIG+2)));
+ result = mgr.getMemoryManagementActions(tablets(t(k("a"), ZERO, QGIG, 0), t(k("b"), ZERO, QGIG + 1, 0), t(k("c"), ZERO, 0, QGIG + 2)));
assertEquals(0, result.tabletsToMinorCompact.size());
// not going to bother compacting any more
mgr.currentTime += ONE_MINUTE;
- result = mgr.getMemoryManagementActions(tablets(
- t(k("a"), ZERO, QGIG, 0),
- t(k("b"), ZERO, QGIG+1, 0),
- t(k("c"), ZERO, 0, QGIG+2)));
+ result = mgr.getMemoryManagementActions(tablets(t(k("a"), ZERO, QGIG, 0), t(k("b"), ZERO, QGIG + 1, 0), t(k("c"), ZERO, 0, QGIG + 2)));
assertEquals(0, result.tabletsToMinorCompact.size());
// now do nothing
mgr.currentTime += ONE_MINUTE;
- result = mgr.getMemoryManagementActions(tablets(
- t(k("a"), ZERO, QGIG, 0),
- t(k("b"), ZERO, 0, 0),
- t(k("c"), ZERO, 0, 0)));
+ result = mgr.getMemoryManagementActions(tablets(t(k("a"), ZERO, QGIG, 0), t(k("b"), ZERO, 0, 0), t(k("c"), ZERO, 0, 0)));
assertEquals(0, result.tabletsToMinorCompact.size());
// on no! more data, this time we compact because we've adjusted
mgr.currentTime += ONE_MINUTE;
- result = mgr.getMemoryManagementActions(tablets(
- t(k("a"), ZERO, QGIG, 0),
- t(k("b"), ZERO, QGIG+1, 0),
- t(k("c"), ZERO, 0, 0)));
+ result = mgr.getMemoryManagementActions(tablets(t(k("a"), ZERO, QGIG, 0), t(k("b"), ZERO, QGIG + 1, 0), t(k("c"), ZERO, 0, 0)));
assertEquals(1, result.tabletsToMinorCompact.size());
assertEquals(k("b"), result.tabletsToMinorCompact.get(0));
}
-
+
private static class LargestFirstMemoryManagerUnderTest extends LargestFirstMemoryManager {
public long currentTime = ZERO;
@@ -239,20 +173,20 @@ public class LargestFirstMemoryManagerTest {
protected long getMinCIdleThreshold(KeyExtent extent) {
return 15 * 60 * 1000;
}
-
+
}
-
+
private static KeyExtent k(String endRow) {
return new KeyExtent(new Text("1"), new Text(endRow), null);
}
-
+
private static class TestTabletState implements TabletState {
-
+
private final KeyExtent extent;
private final long lastCommit;
private final long memSize;
private final long compactingSize;
-
+
TestTabletState(KeyExtent extent, long commit, long memsize, long compactingTableSize) {
this.extent = extent;
this.lastCommit = commit;
@@ -279,14 +213,14 @@ public class LargestFirstMemoryManagerTest {
public long getMinorCompactingMemTableSize() {
return compactingSize;
}
-
+
}
private TabletState t(KeyExtent ke, long lastCommit, long memSize, long compactingSize) {
return new TestTabletState(ke, lastCommit, memSize, compactingSize);
}
-
- private static List<TabletState> tablets(TabletState ... states) {
+
+ private static List<TabletState> tablets(TabletState... states) {
return Arrays.asList(states);
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/6bc67602/server/tserver/src/test/java/org/apache/accumulo/tserver/CheckTabletMetadataTest.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/test/java/org/apache/accumulo/tserver/CheckTabletMetadataTest.java b/server/tserver/src/test/java/org/apache/accumulo/tserver/CheckTabletMetadataTest.java
index 0209278..54be395 100644
--- a/server/tserver/src/test/java/org/apache/accumulo/tserver/CheckTabletMetadataTest.java
+++ b/server/tserver/src/test/java/org/apache/accumulo/tserver/CheckTabletMetadataTest.java
@@ -25,99 +25,98 @@ import org.apache.accumulo.core.data.Value;
import org.apache.accumulo.core.metadata.schema.MetadataSchema.TabletsSection;
import org.apache.accumulo.core.util.ColumnFQ;
import org.apache.accumulo.server.master.state.TServerInstance;
-import org.apache.accumulo.tserver.TabletServer;
import org.apache.hadoop.io.Text;
import org.junit.Assert;
import org.junit.Test;
public class CheckTabletMetadataTest {
-
+
private static Key nk(String row, ColumnFQ cfq) {
return new Key(new Text(row), cfq.getColumnFamily(), cfq.getColumnQualifier());
}
-
+
private static Key nk(String row, Text cf, String cq) {
return new Key(row, cf.toString(), cq);
}
-
+
private static void put(TreeMap<Key,Value> tabletMeta, String row, ColumnFQ cfq, byte[] val) {
Key k = new Key(new Text(row), cfq.getColumnFamily(), cfq.getColumnQualifier());
tabletMeta.put(k, new Value(val));
}
-
+
private static void put(TreeMap<Key,Value> tabletMeta, String row, Text cf, String cq, String val) {
Key k = new Key(new Text(row), cf, new Text(cq));
tabletMeta.put(k, new Value(val.getBytes()));
}
-
+
private static void assertFail(TreeMap<Key,Value> tabletMeta, KeyExtent ke, TServerInstance tsi) {
try {
Assert.assertNull(TabletServer.checkTabletMetadata(ke, tsi, tabletMeta, ke.getMetadataEntry()));
} catch (Exception e) {
-
+
}
}
-
+
private static void assertFail(TreeMap<Key,Value> tabletMeta, KeyExtent ke, TServerInstance tsi, Key keyToDelete) {
TreeMap<Key,Value> copy = new TreeMap<Key,Value>(tabletMeta);
Assert.assertNotNull(copy.remove(keyToDelete));
try {
Assert.assertNull(TabletServer.checkTabletMetadata(ke, tsi, copy, ke.getMetadataEntry()));
} catch (Exception e) {
-
+
}
}
-
+
@Test
public void testBadTabletMetadata() throws Exception {
-
+
KeyExtent ke = new KeyExtent(new Text("1"), null, null);
-
+
TreeMap<Key,Value> tabletMeta = new TreeMap<Key,Value>();
-
+
put(tabletMeta, "1<", TabletsSection.TabletColumnFamily.PREV_ROW_COLUMN, KeyExtent.encodePrevEndRow(null).get());
put(tabletMeta, "1<", TabletsSection.ServerColumnFamily.DIRECTORY_COLUMN, "/t1".getBytes());
put(tabletMeta, "1<", TabletsSection.ServerColumnFamily.TIME_COLUMN, "M0".getBytes());
put(tabletMeta, "1<", TabletsSection.FutureLocationColumnFamily.NAME, "4", "127.0.0.1:9997");
-
+
TServerInstance tsi = new TServerInstance("127.0.0.1:9997", 4);
-
+
Assert.assertNotNull(TabletServer.checkTabletMetadata(ke, tsi, tabletMeta, ke.getMetadataEntry()));
-
+
assertFail(tabletMeta, ke, new TServerInstance("127.0.0.1:9998", 4));
assertFail(tabletMeta, ke, new TServerInstance("127.0.0.1:9998", 5));
assertFail(tabletMeta, ke, new TServerInstance("127.0.0.1:9997", 5));
assertFail(tabletMeta, ke, new TServerInstance("127.0.0.2:9997", 4));
assertFail(tabletMeta, ke, new TServerInstance("127.0.0.2:9997", 5));
-
+
assertFail(tabletMeta, new KeyExtent(new Text("1"), null, new Text("m")), tsi);
-
+
assertFail(tabletMeta, new KeyExtent(new Text("1"), new Text("r"), new Text("m")), tsi);
-
+
assertFail(tabletMeta, ke, tsi, nk("1<", TabletsSection.TabletColumnFamily.PREV_ROW_COLUMN));
-
+
assertFail(tabletMeta, ke, tsi, nk("1<", TabletsSection.ServerColumnFamily.DIRECTORY_COLUMN));
-
+
assertFail(tabletMeta, ke, tsi, nk("1<", TabletsSection.ServerColumnFamily.TIME_COLUMN));
-
+
assertFail(tabletMeta, ke, tsi, nk("1<", TabletsSection.FutureLocationColumnFamily.NAME, "4"));
-
+
TreeMap<Key,Value> copy = new TreeMap<Key,Value>(tabletMeta);
put(copy, "1<", TabletsSection.CurrentLocationColumnFamily.NAME, "4", "127.0.0.1:9997");
assertFail(copy, ke, tsi);
assertFail(copy, ke, tsi, nk("1<", TabletsSection.FutureLocationColumnFamily.NAME, "4"));
-
+
copy = new TreeMap<Key,Value>(tabletMeta);
put(copy, "1<", TabletsSection.CurrentLocationColumnFamily.NAME, "5", "127.0.0.1:9998");
assertFail(copy, ke, tsi);
put(copy, "1<", TabletsSection.CurrentLocationColumnFamily.NAME, "6", "127.0.0.1:9999");
assertFail(copy, ke, tsi);
-
+
copy = new TreeMap<Key,Value>(tabletMeta);
put(copy, "1<", TabletsSection.FutureLocationColumnFamily.NAME, "5", "127.0.0.1:9998");
assertFail(copy, ke, tsi);
-
+
assertFail(new TreeMap<Key,Value>(), ke, tsi);
-
+
}
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/6bc67602/server/tserver/src/test/java/org/apache/accumulo/tserver/CountingIteratorTest.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/test/java/org/apache/accumulo/tserver/CountingIteratorTest.java b/server/tserver/src/test/java/org/apache/accumulo/tserver/CountingIteratorTest.java
index 154b121..8a1dca5 100644
--- a/server/tserver/src/test/java/org/apache/accumulo/tserver/CountingIteratorTest.java
+++ b/server/tserver/src/test/java/org/apache/accumulo/tserver/CountingIteratorTest.java
@@ -31,7 +31,7 @@ import org.junit.Assert;
import org.junit.Test;
/**
- *
+ *
*/
public class CountingIteratorTest {
@Test
http://git-wip-us.apache.org/repos/asf/accumulo/blob/6bc67602/server/tserver/src/test/java/org/apache/accumulo/tserver/InMemoryMapTest.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/test/java/org/apache/accumulo/tserver/InMemoryMapTest.java b/server/tserver/src/test/java/org/apache/accumulo/tserver/InMemoryMapTest.java
index 39c4c39..da7157a 100644
--- a/server/tserver/src/test/java/org/apache/accumulo/tserver/InMemoryMapTest.java
+++ b/server/tserver/src/test/java/org/apache/accumulo/tserver/InMemoryMapTest.java
@@ -267,17 +267,17 @@ public class InMemoryMapTest {
ski1.close();
}
-
+
private void deepCopyAndDelete(int interleaving, boolean interrupt) throws Exception {
// interleaving == 0 intentionally omitted, this runs the test w/o deleting in mem map
InMemoryMap imm = new InMemoryMap(false, tempFolder.newFolder().getAbsolutePath());
-
+
mutate(imm, "r1", "foo:cq1", 3, "bar1");
mutate(imm, "r1", "foo:cq2", 3, "bar2");
-
+
MemoryIterator ski1 = imm.skvIterator();
-
+
AtomicBoolean iflag = new AtomicBoolean(false);
ski1.setInterruptFlag(iflag);
@@ -286,7 +286,7 @@ public class InMemoryMapTest {
if (interrupt)
iflag.set(true);
}
-
+
SortedKeyValueIterator<Key,Value> dc = ski1.deepCopy(null);
if (interleaving == 2) {
@@ -335,7 +335,7 @@ public class InMemoryMapTest {
fail("i = " + i);
} catch (IterationInterruptedException iie) {}
}
-
+
@Test
public void testBug1() throws Exception {
InMemoryMap imm = new InMemoryMap(false, tempFolder.newFolder().getAbsolutePath());
http://git-wip-us.apache.org/repos/asf/accumulo/blob/6bc67602/server/tserver/src/test/java/org/apache/accumulo/tserver/TabletServerSyncCheckTest.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/test/java/org/apache/accumulo/tserver/TabletServerSyncCheckTest.java b/server/tserver/src/test/java/org/apache/accumulo/tserver/TabletServerSyncCheckTest.java
index d35f07f..1a3f9fc 100644
--- a/server/tserver/src/test/java/org/apache/accumulo/tserver/TabletServerSyncCheckTest.java
+++ b/server/tserver/src/test/java/org/apache/accumulo/tserver/TabletServerSyncCheckTest.java
@@ -91,7 +91,6 @@ public class TabletServerSyncCheckTest {
private class TestVolumeManagerImpl extends VolumeManagerImpl {
-
public TestVolumeManagerImpl(Map<String,Volume> volumes) {
super(volumes, volumes.values().iterator().next(), new ConfigurationCopy(Collections.<String,String> emptyMap()));
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/6bc67602/server/tserver/src/test/java/org/apache/accumulo/tserver/TservConstraintEnvTest.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/test/java/org/apache/accumulo/tserver/TservConstraintEnvTest.java b/server/tserver/src/test/java/org/apache/accumulo/tserver/TservConstraintEnvTest.java
index 2676aca..a84e890 100644
--- a/server/tserver/src/test/java/org/apache/accumulo/tserver/TservConstraintEnvTest.java
+++ b/server/tserver/src/test/java/org/apache/accumulo/tserver/TservConstraintEnvTest.java
@@ -16,9 +16,11 @@
*/
package org.apache.accumulo.tserver;
-import static org.junit.Assert.*;
-import static org.powermock.api.easymock.PowerMock.*;
import static org.easymock.EasyMock.expect;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+import static org.powermock.api.easymock.PowerMock.createMock;
+import static org.powermock.api.easymock.PowerMock.replay;
import java.nio.ByteBuffer;
import java.util.Collections;
@@ -29,7 +31,6 @@ import org.apache.accumulo.core.data.ArrayByteSequence;
import org.apache.accumulo.core.data.ByteSequence;
import org.apache.accumulo.core.security.thrift.TCredentials;
import org.apache.accumulo.server.security.SecurityOperation;
-import org.apache.accumulo.tserver.TservConstraintEnv;
import org.junit.Test;
public class TservConstraintEnvTest {
@@ -41,8 +42,7 @@ public class TservConstraintEnvTest {
TCredentials badCred = createMock(TCredentials.class);
ByteSequence bs = new ArrayByteSequence("foo".getBytes());
- List<ByteBuffer> bbList = Collections.<ByteBuffer> singletonList(ByteBuffer.wrap(
- bs.getBackingArray(), bs.offset(), bs.length()));
+ List<ByteBuffer> bbList = Collections.<ByteBuffer> singletonList(ByteBuffer.wrap(bs.getBackingArray(), bs.offset(), bs.length()));
expect(security.userHasAuthorizations(goodCred, bbList)).andReturn(true);
expect(security.userHasAuthorizations(badCred, bbList)).andReturn(false);
@@ -51,4 +51,4 @@ public class TservConstraintEnvTest {
assertTrue(new TservConstraintEnv(security, goodCred).getAuthorizationsContainer().contains(bs));
assertFalse(new TservConstraintEnv(security, badCred).getAuthorizationsContainer().contains(bs));
}
-}
\ No newline at end of file
+}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/6bc67602/server/tserver/src/test/java/org/apache/accumulo/tserver/compaction/CompactionPlanTest.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/test/java/org/apache/accumulo/tserver/compaction/CompactionPlanTest.java b/server/tserver/src/test/java/org/apache/accumulo/tserver/compaction/CompactionPlanTest.java
index 988d87f..1b7d00d 100644
--- a/server/tserver/src/test/java/org/apache/accumulo/tserver/compaction/CompactionPlanTest.java
+++ b/server/tserver/src/test/java/org/apache/accumulo/tserver/compaction/CompactionPlanTest.java
@@ -19,12 +19,13 @@ package org.apache.accumulo.tserver.compaction;
import java.util.Set;
-import com.google.common.collect.ImmutableSet;
import org.apache.accumulo.server.fs.FileRef;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
+import com.google.common.collect.ImmutableSet;
+
public class CompactionPlanTest {
@Rule
http://git-wip-us.apache.org/repos/asf/accumulo/blob/6bc67602/server/tserver/src/test/java/org/apache/accumulo/tserver/compaction/SizeLimitCompactionStrategyTest.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/test/java/org/apache/accumulo/tserver/compaction/SizeLimitCompactionStrategyTest.java b/server/tserver/src/test/java/org/apache/accumulo/tserver/compaction/SizeLimitCompactionStrategyTest.java
index abab34f..ed75a60 100644
--- a/server/tserver/src/test/java/org/apache/accumulo/tserver/compaction/SizeLimitCompactionStrategyTest.java
+++ b/server/tserver/src/test/java/org/apache/accumulo/tserver/compaction/SizeLimitCompactionStrategyTest.java
@@ -30,7 +30,7 @@ import org.junit.Assert;
import org.junit.Test;
/**
- *
+ *
*/
public class SizeLimitCompactionStrategyTest {
private Map<FileRef,DataFileValue> nfl(String... sa) {
http://git-wip-us.apache.org/repos/asf/accumulo/blob/6bc67602/server/tserver/src/test/java/org/apache/accumulo/tserver/constraints/ConstraintCheckerTest.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/test/java/org/apache/accumulo/tserver/constraints/ConstraintCheckerTest.java b/server/tserver/src/test/java/org/apache/accumulo/tserver/constraints/ConstraintCheckerTest.java
index 490c096..dd09f69 100644
--- a/server/tserver/src/test/java/org/apache/accumulo/tserver/constraints/ConstraintCheckerTest.java
+++ b/server/tserver/src/test/java/org/apache/accumulo/tserver/constraints/ConstraintCheckerTest.java
@@ -16,8 +16,13 @@
*/
package org.apache.accumulo.tserver.constraints;
-import static org.easymock.EasyMock.*;
-import static org.junit.Assert.*;
+import static org.easymock.EasyMock.anyObject;
+import static org.easymock.EasyMock.createMock;
+import static org.easymock.EasyMock.createMockBuilder;
+import static org.easymock.EasyMock.expect;
+import static org.easymock.EasyMock.replay;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
import java.util.ArrayList;
import java.util.List;
@@ -47,9 +52,7 @@ public class ConstraintCheckerTest {
@Before
public void setup() throws NoSuchMethodException, SecurityException {
- cc = createMockBuilder(ConstraintChecker.class)
- .addMockedMethod("getConstraints")
- .createMock();
+ cc = createMockBuilder(ConstraintChecker.class).addMockedMethod("getConstraints").createMock();
constraints = new ArrayList<Constraint>();
expect(cc.getConstraints()).andReturn(constraints);
http://git-wip-us.apache.org/repos/asf/accumulo/blob/6bc67602/server/tserver/src/test/java/org/apache/accumulo/tserver/log/DfsLoggerTest.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/test/java/org/apache/accumulo/tserver/log/DfsLoggerTest.java b/server/tserver/src/test/java/org/apache/accumulo/tserver/log/DfsLoggerTest.java
index 2ae37ed..cd652e4 100644
--- a/server/tserver/src/test/java/org/apache/accumulo/tserver/log/DfsLoggerTest.java
+++ b/server/tserver/src/test/java/org/apache/accumulo/tserver/log/DfsLoggerTest.java
@@ -16,7 +16,7 @@
*/
package org.apache.accumulo.tserver.log;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
import java.util.ArrayList;
import java.util.Collections;
@@ -28,32 +28,32 @@ import org.apache.accumulo.tserver.TabletMutations;
import org.junit.Test;
public class DfsLoggerTest {
-
+
@Test
public void testDurabilityForGroupCommit() {
List<TabletMutations> lst = new ArrayList<TabletMutations>();
assertEquals(Durability.NONE, DfsLogger.chooseDurabilityForGroupCommit(lst));
- TabletMutations m1 = new TabletMutations(0, 1, Collections.<Mutation>emptyList(), Durability.NONE);
+ TabletMutations m1 = new TabletMutations(0, 1, Collections.<Mutation> emptyList(), Durability.NONE);
lst.add(m1);
assertEquals(Durability.NONE, DfsLogger.chooseDurabilityForGroupCommit(lst));
- TabletMutations m2 = new TabletMutations(0, 1, Collections.<Mutation>emptyList(), Durability.LOG);
+ TabletMutations m2 = new TabletMutations(0, 1, Collections.<Mutation> emptyList(), Durability.LOG);
lst.add(m2);
assertEquals(Durability.LOG, DfsLogger.chooseDurabilityForGroupCommit(lst));
- TabletMutations m3 = new TabletMutations(0, 1, Collections.<Mutation>emptyList(), Durability.NONE);
+ TabletMutations m3 = new TabletMutations(0, 1, Collections.<Mutation> emptyList(), Durability.NONE);
lst.add(m3);
assertEquals(Durability.LOG, DfsLogger.chooseDurabilityForGroupCommit(lst));
- TabletMutations m4 = new TabletMutations(0, 1, Collections.<Mutation>emptyList(), Durability.FLUSH);
+ TabletMutations m4 = new TabletMutations(0, 1, Collections.<Mutation> emptyList(), Durability.FLUSH);
lst.add(m4);
assertEquals(Durability.FLUSH, DfsLogger.chooseDurabilityForGroupCommit(lst));
- TabletMutations m5 = new TabletMutations(0, 1, Collections.<Mutation>emptyList(), Durability.LOG);
+ TabletMutations m5 = new TabletMutations(0, 1, Collections.<Mutation> emptyList(), Durability.LOG);
lst.add(m5);
assertEquals(Durability.FLUSH, DfsLogger.chooseDurabilityForGroupCommit(lst));
- TabletMutations m6 = new TabletMutations(0, 1, Collections.<Mutation>emptyList(), Durability.SYNC);
+ TabletMutations m6 = new TabletMutations(0, 1, Collections.<Mutation> emptyList(), Durability.SYNC);
lst.add(m6);
assertEquals(Durability.SYNC, DfsLogger.chooseDurabilityForGroupCommit(lst));
- TabletMutations m7 = new TabletMutations(0, 1, Collections.<Mutation>emptyList(), Durability.FLUSH);
+ TabletMutations m7 = new TabletMutations(0, 1, Collections.<Mutation> emptyList(), Durability.FLUSH);
lst.add(m7);
assertEquals(Durability.SYNC, DfsLogger.chooseDurabilityForGroupCommit(lst));
}
-
+
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/6bc67602/server/tserver/src/test/java/org/apache/accumulo/tserver/log/SortedLogRecoveryTest.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/test/java/org/apache/accumulo/tserver/log/SortedLogRecoveryTest.java b/server/tserver/src/test/java/org/apache/accumulo/tserver/log/SortedLogRecoveryTest.java
index 03361d1..67cdb04 100644
--- a/server/tserver/src/test/java/org/apache/accumulo/tserver/log/SortedLogRecoveryTest.java
+++ b/server/tserver/src/test/java/org/apache/accumulo/tserver/log/SortedLogRecoveryTest.java
@@ -611,8 +611,8 @@ public class SortedLogRecoveryTest {
Mutation m2 = new ServerMutation(new Text("row1"));
m2.put("foo", "bar", "v2");
- KeyValue entries[] = new KeyValue[] {createKeyValue(OPEN, 0, -1, "1"), createKeyValue(DEFINE_TABLET, 1, 2, extent),
- createKeyValue(MUTATION, 2, 2, m1), createKeyValue(COMPACTION_START, 3, 2, compactionStartFile), createKeyValue(MUTATION, 4, 2, m2),};
+ KeyValue entries[] = new KeyValue[] {createKeyValue(OPEN, 0, -1, "1"), createKeyValue(DEFINE_TABLET, 1, 2, extent), createKeyValue(MUTATION, 2, 2, m1),
+ createKeyValue(COMPACTION_START, 3, 2, compactionStartFile), createKeyValue(MUTATION, 4, 2, m2),};
Arrays.sort(entries);
Map<String,KeyValue[]> logs = new TreeMap<String,KeyValue[]>();
http://git-wip-us.apache.org/repos/asf/accumulo/blob/6bc67602/server/tserver/src/test/java/org/apache/accumulo/tserver/log/TestUpgradePathForWALogs.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/test/java/org/apache/accumulo/tserver/log/TestUpgradePathForWALogs.java b/server/tserver/src/test/java/org/apache/accumulo/tserver/log/TestUpgradePathForWALogs.java
index 1014306..45d3e73 100644
--- a/server/tserver/src/test/java/org/apache/accumulo/tserver/log/TestUpgradePathForWALogs.java
+++ b/server/tserver/src/test/java/org/apache/accumulo/tserver/log/TestUpgradePathForWALogs.java
@@ -50,7 +50,7 @@ public class TestUpgradePathForWALogs {
public static void createTestDirectory() {
File baseDir = new File(System.getProperty("user.dir") + "/target/upgrade-tests");
baseDir.mkdirs();
- testDir = new File(baseDir, TestUpgradePathForWALogs.class.getName());
+ testDir = new File(baseDir, TestUpgradePathForWALogs.class.getName());
FileUtils.deleteQuietly(testDir);
testDir.mkdir();
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/6bc67602/server/tserver/src/test/java/org/apache/accumulo/tserver/logger/LogFileTest.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/test/java/org/apache/accumulo/tserver/logger/LogFileTest.java b/server/tserver/src/test/java/org/apache/accumulo/tserver/logger/LogFileTest.java
index f91c195..cf2266f 100644
--- a/server/tserver/src/test/java/org/apache/accumulo/tserver/logger/LogFileTest.java
+++ b/server/tserver/src/test/java/org/apache/accumulo/tserver/logger/LogFileTest.java
@@ -33,16 +33,13 @@ import org.apache.accumulo.core.data.Mutation;
import org.apache.accumulo.core.data.Value;
import org.apache.accumulo.core.security.ColumnVisibility;
import org.apache.accumulo.server.data.ServerMutation;
-import org.apache.accumulo.tserver.logger.LogEvents;
-import org.apache.accumulo.tserver.logger.LogFileKey;
-import org.apache.accumulo.tserver.logger.LogFileValue;
import org.apache.hadoop.io.DataInputBuffer;
import org.apache.hadoop.io.DataOutputBuffer;
import org.apache.hadoop.io.Text;
import org.junit.Test;
public class LogFileTest {
-
+
static private void readWrite(LogEvents event, long seq, int tid, String filename, KeyExtent tablet, Mutation[] mutations, LogFileKey keyResult,
LogFileValue valueResult) throws IOException {
LogFileKey key = new LogFileKey();
@@ -66,7 +63,7 @@ public class LogFileTest {
assertEquals(value.mutations, valueResult.mutations);
assertTrue(in.read() == -1);
}
-
+
@Test
public void testReadFields() throws IOException {
LogFileKey key = new LogFileKey();
@@ -111,14 +108,14 @@ public class LogFileTest {
assertEquals(key.tid, 10);
assertEquals(value.mutations, Arrays.asList(m, m));
}
-
+
@Test
public void testEventType() {
assertEquals(LogFileKey.eventType(MUTATION), LogFileKey.eventType(MANY_MUTATIONS));
assertEquals(LogFileKey.eventType(COMPACTION_START), LogFileKey.eventType(COMPACTION_FINISH));
assertTrue(LogFileKey.eventType(DEFINE_TABLET) < LogFileKey.eventType(COMPACTION_FINISH));
assertTrue(LogFileKey.eventType(COMPACTION_FINISH) < LogFileKey.eventType(MUTATION));
-
+
}
-
+
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/6bc67602/server/tserver/src/test/java/org/apache/accumulo/tserver/replication/AccumuloReplicaSystemTest.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/test/java/org/apache/accumulo/tserver/replication/AccumuloReplicaSystemTest.java b/server/tserver/src/test/java/org/apache/accumulo/tserver/replication/AccumuloReplicaSystemTest.java
index 90a2aa4..1a32ea4 100644
--- a/server/tserver/src/test/java/org/apache/accumulo/tserver/replication/AccumuloReplicaSystemTest.java
+++ b/server/tserver/src/test/java/org/apache/accumulo/tserver/replication/AccumuloReplicaSystemTest.java
@@ -59,7 +59,7 @@ import org.junit.Assert;
import org.junit.Test;
/**
- *
+ *
*/
public class AccumuloReplicaSystemTest {
@@ -159,7 +159,8 @@ public class AccumuloReplicaSystemTest {
Status status = Status.newBuilder().setBegin(0).setEnd(0).setInfiniteEnd(true).setClosed(false).build();
DataInputStream dis = new DataInputStream(new ByteArrayInputStream(baos.toByteArray()));
- WalReplication repl = ars.getWalEdits(new ReplicationTarget("peer", "1", "1"), dis, new Path("/accumulo/wals/tserver+port/wal"), status, Long.MAX_VALUE, new HashSet<Integer>());
+ WalReplication repl = ars.getWalEdits(new ReplicationTarget("peer", "1", "1"), dis, new Path("/accumulo/wals/tserver+port/wal"), status, Long.MAX_VALUE,
+ new HashSet<Integer>());
// We stopped because we got to the end of the file
Assert.assertEquals(9, repl.entriesConsumed);
@@ -266,7 +267,8 @@ public class AccumuloReplicaSystemTest {
// If it were still open, more data could be appended that we need to process
Status status = Status.newBuilder().setBegin(0).setEnd(0).setInfiniteEnd(true).setClosed(true).build();
DataInputStream dis = new DataInputStream(new ByteArrayInputStream(baos.toByteArray()));
- WalReplication repl = ars.getWalEdits(new ReplicationTarget("peer", "1", "1"), dis, new Path("/accumulo/wals/tserver+port/wal"), status, Long.MAX_VALUE, new HashSet<Integer>());
+ WalReplication repl = ars.getWalEdits(new ReplicationTarget("peer", "1", "1"), dis, new Path("/accumulo/wals/tserver+port/wal"), status, Long.MAX_VALUE,
+ new HashSet<Integer>());
// We stopped because we got to the end of the file
Assert.assertEquals(Long.MAX_VALUE, repl.entriesConsumed);
@@ -331,7 +333,8 @@ public class AccumuloReplicaSystemTest {
// If it were still open, more data could be appended that we need to process
Status status = Status.newBuilder().setBegin(100).setEnd(0).setInfiniteEnd(true).setClosed(true).build();
DataInputStream dis = new DataInputStream(new ByteArrayInputStream(new byte[0]));
- WalReplication repl = ars.getWalEdits(new ReplicationTarget("peer", "1", "1"), dis, new Path("/accumulo/wals/tserver+port/wal"), status, Long.MAX_VALUE, new HashSet<Integer>());
+ WalReplication repl = ars.getWalEdits(new ReplicationTarget("peer", "1", "1"), dis, new Path("/accumulo/wals/tserver+port/wal"), status, Long.MAX_VALUE,
+ new HashSet<Integer>());
// We stopped because we got to the end of the file
Assert.assertEquals(Long.MAX_VALUE, repl.entriesConsumed);
@@ -353,7 +356,8 @@ public class AccumuloReplicaSystemTest {
// If it were still open, more data could be appended that we need to process
Status status = Status.newBuilder().setBegin(100).setEnd(0).setInfiniteEnd(true).setClosed(false).build();
DataInputStream dis = new DataInputStream(new ByteArrayInputStream(new byte[0]));
- WalReplication repl = ars.getWalEdits(new ReplicationTarget("peer", "1", "1"), dis, new Path("/accumulo/wals/tserver+port/wal"), status, Long.MAX_VALUE, new HashSet<Integer>());
+ WalReplication repl = ars.getWalEdits(new ReplicationTarget("peer", "1", "1"), dis, new Path("/accumulo/wals/tserver+port/wal"), status, Long.MAX_VALUE,
+ new HashSet<Integer>());
// We stopped because we got to the end of the file
Assert.assertEquals(0, repl.entriesConsumed);
http://git-wip-us.apache.org/repos/asf/accumulo/blob/6bc67602/server/tserver/src/test/java/org/apache/accumulo/tserver/replication/BatchWriterReplicationReplayerTest.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/test/java/org/apache/accumulo/tserver/replication/BatchWriterReplicationReplayerTest.java b/server/tserver/src/test/java/org/apache/accumulo/tserver/replication/BatchWriterReplicationReplayerTest.java
index aba0b1c..4584f56 100644
--- a/server/tserver/src/test/java/org/apache/accumulo/tserver/replication/BatchWriterReplicationReplayerTest.java
+++ b/server/tserver/src/test/java/org/apache/accumulo/tserver/replication/BatchWriterReplicationReplayerTest.java
@@ -47,7 +47,7 @@ import org.junit.Test;
import com.google.common.collect.Lists;
/**
- *
+ *
*/
public class BatchWriterReplicationReplayerTest {
@@ -80,7 +80,6 @@ public class BatchWriterReplicationReplayerTest {
final BatchWriterConfig bwCfg = new BatchWriterConfig();
bwCfg.setMaxMemory(1l);
-
LogFileKey key = new LogFileKey();
key.event = LogEvents.MANY_MUTATIONS;
key.seq = 1;
@@ -133,7 +132,7 @@ public class BatchWriterReplicationReplayerTest {
expectLastCall().once();
replay(conn, conf, bw);
-
+
replayer.replicateLog(context, tableName, edits);
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/6bc67602/server/tserver/src/test/java/org/apache/accumulo/tserver/replication/ReplicationProcessorTest.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/test/java/org/apache/accumulo/tserver/replication/ReplicationProcessorTest.java b/server/tserver/src/test/java/org/apache/accumulo/tserver/replication/ReplicationProcessorTest.java
index d389c0b..15306a8 100644
--- a/server/tserver/src/test/java/org/apache/accumulo/tserver/replication/ReplicationProcessorTest.java
+++ b/server/tserver/src/test/java/org/apache/accumulo/tserver/replication/ReplicationProcessorTest.java
@@ -38,7 +38,7 @@ import org.junit.Assert;
import org.junit.Test;
/**
- *
+ *
*/
public class ReplicationProcessorTest {
@@ -78,7 +78,8 @@ public class ReplicationProcessorTest {
public void filesWhichMakeNoProgressArentReplicatedAgain() throws Exception {
ReplicaSystem replica = EasyMock.createMock(ReplicaSystem.class);
ReplicaSystemHelper helper = EasyMock.createMock(ReplicaSystemHelper.class);
- ReplicationProcessor proc = EasyMock.createMockBuilder(ReplicationProcessor.class).addMockedMethods("getReplicaSystem", "doesFileExist", "getStatus", "getHelper").createMock();
+ ReplicationProcessor proc = EasyMock.createMockBuilder(ReplicationProcessor.class)
+ .addMockedMethods("getReplicaSystem", "doesFileExist", "getStatus", "getHelper").createMock();
ReplicationTarget target = new ReplicationTarget("peer", "1", "1");
Status status = Status.newBuilder().setBegin(0).setEnd(0).setInfiniteEnd(true).setClosed(true).build();
http://git-wip-us.apache.org/repos/asf/accumulo/blob/6bc67602/server/tserver/src/test/java/org/apache/accumulo/tserver/tablet/RootFilesTest.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/test/java/org/apache/accumulo/tserver/tablet/RootFilesTest.java b/server/tserver/src/test/java/org/apache/accumulo/tserver/tablet/RootFilesTest.java
index 9c75a66..743cfc2 100644
--- a/server/tserver/src/test/java/org/apache/accumulo/tserver/tablet/RootFilesTest.java
+++ b/server/tserver/src/test/java/org/apache/accumulo/tserver/tablet/RootFilesTest.java
@@ -29,7 +29,6 @@ import org.apache.accumulo.core.conf.Property;
import org.apache.accumulo.server.fs.FileRef;
import org.apache.accumulo.server.fs.VolumeManager;
import org.apache.accumulo.server.fs.VolumeManagerImpl;
-import org.apache.accumulo.tserver.tablet.RootFiles;
import org.apache.hadoop.fs.Path;
import org.junit.Assert;
import org.junit.Rule;
@@ -37,7 +36,7 @@ import org.junit.Test;
import org.junit.rules.TemporaryFolder;
/**
- *
+ *
*/
public class RootFilesTest {
http://git-wip-us.apache.org/repos/asf/accumulo/blob/6bc67602/server/tserver/src/test/java/org/apache/accumulo/tserver/tablet/TabletTest.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/test/java/org/apache/accumulo/tserver/tablet/TabletTest.java b/server/tserver/src/test/java/org/apache/accumulo/tserver/tablet/TabletTest.java
index a40a871..c4969e6 100644
--- a/server/tserver/src/test/java/org/apache/accumulo/tserver/tablet/TabletTest.java
+++ b/server/tserver/src/test/java/org/apache/accumulo/tserver/tablet/TabletTest.java
@@ -36,7 +36,7 @@ import org.junit.Test;
import com.google.common.collect.Iterators;
/**
- *
+ *
*/
public class TabletTest {
@@ -55,7 +55,7 @@ public class TabletTest {
ConfigurationObserver obs = EasyMock.createMock(ConfigurationObserver.class);
Tablet tablet = new Tablet(time, "", 0, new Path("/foo"), dfm, tserver, tserverResourceManager, tabletMemory, tableConf, extent, obs);
-
+
long hdfsBlockSize = 10000l, blockSize = 5000l, indexBlockSize = 500l;
int replication = 5;
String compressType = "snappy";
http://git-wip-us.apache.org/repos/asf/accumulo/blob/6bc67602/shell/src/main/java/org/apache/accumulo/shell/Shell.java
----------------------------------------------------------------------
diff --git a/shell/src/main/java/org/apache/accumulo/shell/Shell.java b/shell/src/main/java/org/apache/accumulo/shell/Shell.java
index 58308ff..9697a85 100644
--- a/shell/src/main/java/org/apache/accumulo/shell/Shell.java
+++ b/shell/src/main/java/org/apache/accumulo/shell/Shell.java
@@ -229,9 +229,8 @@ public class Shell extends ShellOptions {
private boolean masking = false;
public Shell() throws IOException {
- this(new ConsoleReader(), new PrintWriter(
- new OutputStreamWriter(System.out,
- System.getProperty("jline.WindowsTerminal.output.encoding", System.getProperty("file.encoding")))));
+ this(new ConsoleReader(), new PrintWriter(new OutputStreamWriter(System.out, System.getProperty("jline.WindowsTerminal.output.encoding",
+ System.getProperty("file.encoding")))));
}
public Shell(ConsoleReader reader, PrintWriter writer) {