You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by el...@apache.org on 2014/06/05 06:42:51 UTC
[09/35] git commit: ACCUMULO-2041 updates from initial review
ACCUMULO-2041 updates from initial review
Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/80498591
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/80498591
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/80498591
Branch: refs/heads/ACCUMULO-378
Commit: 8049859154dc5cab5a5a0ce1d6babaf243c06922
Parents: 7db2abf
Author: Eric C. Newton <er...@gmail.com>
Authored: Mon Apr 21 15:27:15 2014 -0400
Committer: Eric C. Newton <er...@gmail.com>
Committed: Tue Jun 3 10:49:43 2014 -0400
----------------------------------------------------------------------
.../accumulo/tserver/CountingIterator.java | 78 ++++++++++++++++++++
.../apache/accumulo/tserver/TabletServer.java | 4 +-
.../apache/accumulo/tserver/tablet/Batch.java | 26 +++++--
.../tserver/tablet/CompactionRunner.java | 2 +-
.../tserver/tablet/CompactionWatcher.java | 1 +
.../accumulo/tserver/tablet/Compactor.java | 54 +-------------
.../tserver/tablet/MinorCompactionTask.java | 9 ++-
.../accumulo/tserver/tablet/ScanBatch.java | 14 +++-
.../accumulo/tserver/tablet/ScanDataSource.java | 10 +--
.../accumulo/tserver/tablet/ScanOptions.java | 49 +++++++++---
.../apache/accumulo/tserver/tablet/Scanner.java | 27 +++----
.../accumulo/tserver/tablet/SplitInfo.java | 38 ++++++++--
.../apache/accumulo/tserver/tablet/Tablet.java | 4 +-
.../accumulo/tserver/CountingIteratorTest.java | 1 -
14 files changed, 213 insertions(+), 104 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/accumulo/blob/80498591/server/tserver/src/main/java/org/apache/accumulo/tserver/CountingIterator.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/CountingIterator.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/CountingIterator.java
new file mode 100644
index 0000000..e4ba076
--- /dev/null
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/CountingIterator.java
@@ -0,0 +1,78 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.accumulo.tserver;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Map;
+import java.util.concurrent.atomic.AtomicLong;
+
+import org.apache.accumulo.core.data.Key;
+import org.apache.accumulo.core.data.Value;
+import org.apache.accumulo.core.iterators.IteratorEnvironment;
+import org.apache.accumulo.core.iterators.SortedKeyValueIterator;
+import org.apache.accumulo.core.iterators.WrappingIterator;
+
+public class CountingIterator extends WrappingIterator {
+
+ private long count;
+ private final ArrayList<CountingIterator> deepCopies;
+ private final AtomicLong entriesRead;
+
+ @Override
+ public CountingIterator deepCopy(IteratorEnvironment env) {
+ return new CountingIterator(this, env);
+ }
+
+ private CountingIterator(CountingIterator other, IteratorEnvironment env) {
+ setSource(other.getSource().deepCopy(env));
+ count = 0;
+ this.deepCopies = other.deepCopies;
+ this.entriesRead = other.entriesRead;
+ deepCopies.add(this);
+ }
+
+ public CountingIterator(SortedKeyValueIterator<Key,Value> source, AtomicLong entriesRead) {
+ deepCopies = new ArrayList<CountingIterator>();
+ this.setSource(source);
+ count = 0;
+ this.entriesRead = entriesRead;
+ }
+
+ @Override
+ public void init(SortedKeyValueIterator<Key,Value> source, Map<String,String> options, IteratorEnvironment env) {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public void next() throws IOException {
+ super.next();
+ count++;
+ if (count % 1024 == 0) {
+ entriesRead.addAndGet(1024);
+ }
+ }
+
+ public long getCount() {
+ long sum = 0;
+ for (CountingIterator dc : deepCopies) {
+ sum += dc.count;
+ }
+
+ return count + sum;
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/accumulo/blob/80498591/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java
index 1c07c44..2a453a8 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java
@@ -1303,7 +1303,7 @@ public class TabletServer extends AbstractMetricsImpl implements org.apache.accu
throw new RuntimeException(t);
}
- ScanResult scanResult = new ScanResult(Key.compress(bresult.results), bresult.more);
+ ScanResult scanResult = new ScanResult(Key.compress(bresult.getResults()), bresult.isMore());
scanSession.entriesReturned += scanResult.results.size();
@@ -1859,7 +1859,7 @@ public class TabletServer extends AbstractMetricsImpl implements org.apache.accu
Value val = null;
- for (KVEntry entry2 : batch.results) {
+ for (KVEntry entry2 : batch.getResults()) {
val = entry2.getValue();
break;
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/80498591/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 73434c6..1a83ba4 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
@@ -20,11 +20,11 @@ import java.util.List;
import org.apache.accumulo.core.data.Key;
-class Batch {
- final boolean skipContinueKey;
- final List<KVEntry> results;
- final Key continueKey;
- final long numBytes;
+final class Batch {
+ private final boolean skipContinueKey;
+ 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;
@@ -32,4 +32,20 @@ class Batch {
this.continueKey = continueKey;
this.numBytes = numBytes;
}
+
+ public boolean isSkipContinueKey() {
+ return skipContinueKey;
+ }
+
+ public List<KVEntry> getResults() {
+ return results;
+ }
+
+ public Key getContinueKey() {
+ return continueKey;
+ }
+
+ public long getNumBytes() {
+ return numBytes;
+ }
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/accumulo/blob/80498591/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 de5a66d..1dee64b 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
@@ -18,7 +18,7 @@ package org.apache.accumulo.tserver.tablet;
import org.apache.accumulo.tserver.compaction.MajorCompactionReason;
-class CompactionRunner implements Runnable, Comparable<CompactionRunner> {
+final class CompactionRunner implements Runnable, Comparable<CompactionRunner> {
private final Tablet tablet;
private final MajorCompactionReason reason;
http://git-wip-us.apache.org/repos/asf/accumulo/blob/80498591/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 1ca1f33..adc01b2 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
@@ -51,6 +51,7 @@ public class CompactionWatcher implements Runnable {
this.config = config;
}
+ @Override
public void run() {
List<CompactionInfo> runningCompactions = Compactor.getRunningCompactions();
http://git-wip-us.apache.org/repos/asf/accumulo/blob/80498591/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 2a3e2f4..9a93be3 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
@@ -40,11 +40,9 @@ import org.apache.accumulo.core.data.Value;
import org.apache.accumulo.core.file.FileOperations;
import org.apache.accumulo.core.file.FileSKVIterator;
import org.apache.accumulo.core.file.FileSKVWriter;
-import org.apache.accumulo.core.iterators.IteratorEnvironment;
import org.apache.accumulo.core.iterators.IteratorUtil;
import org.apache.accumulo.core.iterators.IteratorUtil.IteratorScope;
import org.apache.accumulo.core.iterators.SortedKeyValueIterator;
-import org.apache.accumulo.core.iterators.WrappingIterator;
import org.apache.accumulo.core.iterators.system.ColumnFamilySkippingIterator;
import org.apache.accumulo.core.iterators.system.DeletingIterator;
import org.apache.accumulo.core.iterators.system.MultiIterator;
@@ -60,6 +58,7 @@ import org.apache.accumulo.server.problems.ProblemReports;
import org.apache.accumulo.server.problems.ProblemType;
import org.apache.accumulo.trace.instrument.Span;
import org.apache.accumulo.trace.instrument.Trace;
+import org.apache.accumulo.tserver.CountingIterator;
import org.apache.accumulo.tserver.InMemoryMap;
import org.apache.accumulo.tserver.MinorCompactionReason;
import org.apache.accumulo.tserver.TabletIteratorEnvironment;
@@ -71,57 +70,6 @@ public class Compactor implements Callable<CompactionStats> {
private static final Logger log = Logger.getLogger(Compactor.class);
private static final AtomicLong nextCompactorID = new AtomicLong(0);
- public static class CountingIterator extends WrappingIterator {
-
- private long count;
- private final ArrayList<CountingIterator> deepCopies;
- private final AtomicLong entriesRead;
-
- @Override
- public CountingIterator deepCopy(IteratorEnvironment env) {
- return new CountingIterator(this, env);
- }
-
- private CountingIterator(CountingIterator other, IteratorEnvironment env) {
- setSource(other.getSource().deepCopy(env));
- count = 0;
- this.deepCopies = other.deepCopies;
- this.entriesRead = other.entriesRead;
- deepCopies.add(this);
- }
-
- public CountingIterator(SortedKeyValueIterator<Key,Value> source, AtomicLong entriesRead) {
- deepCopies = new ArrayList<Compactor.CountingIterator>();
- this.setSource(source);
- count = 0;
- this.entriesRead = entriesRead;
- }
-
- @Override
- public void init(SortedKeyValueIterator<Key,Value> source, Map<String,String> options, IteratorEnvironment env) {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public void next() throws IOException {
- super.next();
- count++;
- if (count % 1024 == 0) {
- entriesRead.addAndGet(1024);
- }
- }
-
- public long getCount() {
- long sum = 0;
- for (CountingIterator dc : deepCopies) {
- sum += dc.count;
- }
-
- return count + sum;
- }
- }
-
-
public static class CompactionCanceledException extends Exception {
private static final long serialVersionUID = 1L;
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/80498591/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 9278cb2..6183824 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
@@ -24,9 +24,12 @@ import org.apache.accumulo.trace.instrument.Span;
import org.apache.accumulo.trace.instrument.Trace;
import org.apache.accumulo.tserver.MinorCompactionReason;
import org.apache.accumulo.tserver.compaction.MajorCompactionReason;
+import org.apache.log4j.Logger;
class MinorCompactionTask implements Runnable {
+ private static Logger log = Logger.getLogger(MinorCompactionTask.class);
+
private final Tablet tablet;
private long queued;
private CommitSession commitSession;
@@ -47,7 +50,7 @@ class MinorCompactionTask implements Runnable {
@Override
public void run() {
- tablet.isMinorCompactionRunning();
+ tablet.minorCompactionStarted();
Span minorCompaction = Trace.on("minorCompaction");
try {
FileRef newMapfileLocation = tablet.getNextMapFilename(mergeFile == null ? "F" : "M");
@@ -68,7 +71,7 @@ class MinorCompactionTask implements Runnable {
tablet.getTabletServer().minorCompactionStarted(commitSession, commitSession.getWALogSeq() + 1, newMapfileLocation.path().toString());
break;
} catch (IOException e) {
- Tablet.log.warn("Failed to write to write ahead log " + e.getMessage(), e);
+ log.warn("Failed to write to write ahead log " + e.getMessage(), e);
}
}
span.stop();
@@ -83,7 +86,7 @@ class MinorCompactionTask implements Runnable {
tablet.initiateMajorCompaction(MajorCompactionReason.NORMAL);
}
} catch (Throwable t) {
- Tablet.log.error("Unknown error during minor compaction for extent: " + tablet.getExtent(), t);
+ log.error("Unknown error during minor compaction for extent: " + tablet.getExtent(), t);
throw new RuntimeException(t);
} finally {
tablet.minorCompactionComplete();
http://git-wip-us.apache.org/repos/asf/accumulo/blob/80498591/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 0ea76d3..dc932c6 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
@@ -18,12 +18,20 @@ package org.apache.accumulo.tserver.tablet;
import java.util.List;
-public class ScanBatch {
- public final boolean more;
- public final List<KVEntry> results;
+final public class ScanBatch {
+ private final boolean more;
+ private final List<KVEntry> results;
ScanBatch(List<KVEntry> results, boolean more) {
this.results = results;
this.more = more;
}
+
+ public boolean isMore() {
+ return more;
+ }
+
+ public List<KVEntry> getResults() {
+ return results;
+ }
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/accumulo/blob/80498591/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 980a082..5464731 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
@@ -76,7 +76,7 @@ class ScanDataSource implements DataSource {
this.tablet = tablet;
expectedDeletionCount = tablet.getDataSourceDeletions();
this.options = options;
- this.interruptFlag = options.interruptFlag;
+ this.interruptFlag = options.getInterruptFlag();
}
@Override
@@ -147,7 +147,7 @@ class ScanDataSource implements DataSource {
files = reservation.getSecond();
}
- Collection<InterruptibleIterator> mapfiles = fileManager.openFiles(files, options.isolated);
+ Collection<InterruptibleIterator> mapfiles = fileManager.openFiles(files, options.isIsolated());
List<SortedKeyValueIterator<Key,Value>> iters = new ArrayList<SortedKeyValueIterator<Key,Value>>(mapfiles.size() + memIters.size());
@@ -167,12 +167,12 @@ class ScanDataSource implements DataSource {
ColumnFamilySkippingIterator cfsi = new ColumnFamilySkippingIterator(delIter);
- ColumnQualifierFilter colFilter = new ColumnQualifierFilter(cfsi, options.columnSet);
+ ColumnQualifierFilter colFilter = new ColumnQualifierFilter(cfsi, options.getColumnSet());
- VisibilityFilter visFilter = new VisibilityFilter(colFilter, options.authorizations, options.defaultLabels);
+ VisibilityFilter visFilter = new VisibilityFilter(colFilter, options.getAuthorizations(), options.getDefaultLabels());
return iterEnv.getTopLevelIterator(IteratorUtil
- .loadIterators(IteratorScope.scan, visFilter, tablet.getExtent(), tablet.getTableConfiguration(), options.ssiList, options.ssio, iterEnv));
+ .loadIterators(IteratorScope.scan, visFilter, tablet.getExtent(), tablet.getTableConfiguration(), options.getSsiList(), options.getSsio(), iterEnv));
}
void close(boolean sawErrors) {
http://git-wip-us.apache.org/repos/asf/accumulo/blob/80498591/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 9382ea7..07aa8e7 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
@@ -25,16 +25,16 @@ import org.apache.accumulo.core.data.Column;
import org.apache.accumulo.core.data.thrift.IterInfo;
import org.apache.accumulo.core.security.Authorizations;
-class ScanOptions {
+final class ScanOptions {
- final Authorizations authorizations;
- final byte[] defaultLabels;
- final Set<Column> columnSet;
- final List<IterInfo> ssiList;
- final Map<String,Map<String,String>> ssio;
- final AtomicBoolean interruptFlag;
- final int num;
- final boolean isolated;
+ private final Authorizations authorizations;
+ private final byte[] defaultLabels;
+ private final Set<Column> columnSet;
+ private final List<IterInfo> ssiList;
+ private final Map<String,Map<String,String>> ssio;
+ private final AtomicBoolean interruptFlag;
+ 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) {
@@ -48,4 +48,35 @@ class ScanOptions {
this.isolated = isolated;
}
+ public Authorizations getAuthorizations() {
+ return authorizations;
+ }
+
+ public byte[] getDefaultLabels() {
+ return defaultLabels;
+ }
+
+ public Set<Column> getColumnSet() {
+ return columnSet;
+ }
+
+ public List<IterInfo> getSsiList() {
+ return ssiList;
+ }
+
+ public Map<String,Map<String,String>> getSsio() {
+ return ssio;
+ }
+
+ public AtomicBoolean getInterruptFlag() {
+ return interruptFlag;
+ }
+
+ public int getNum() {
+ return num;
+ }
+
+ public boolean isIsolated() {
+ return isolated;
+ }
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/accumulo/blob/80498591/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 96379fc..ad3fcb2 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
@@ -56,7 +56,7 @@ public class Scanner {
ScanDataSource dataSource;
- if (options.isolated) {
+ if (options.isIsolated()) {
if (isolatedDataSource == null)
isolatedDataSource = new ScanDataSource(tablet, options);
dataSource = isolatedDataSource;
@@ -68,7 +68,7 @@ public class Scanner {
SortedKeyValueIterator<Key,Value> iter;
- if (options.isolated) {
+ if (options.isIsolated()) {
if (isolatedIter == null)
isolatedIter = new SourceSwitchingIterator(dataSource, true);
else
@@ -78,16 +78,16 @@ public class Scanner {
iter = new SourceSwitchingIterator(dataSource, false);
}
- results = tablet.nextBatch(iter, range, options.num, options.columnSet);
+ results = tablet.nextBatch(iter, range, options.getNum(), options.getColumnSet());
- if (results.results == null) {
+ if (results.getResults() == null) {
range = null;
return new ScanBatch(new ArrayList<KVEntry>(), false);
- } else if (results.continueKey == null) {
- return new ScanBatch(results.results, false);
+ } else if (results.getContinueKey() == null) {
+ return new ScanBatch(results.getResults(), false);
} else {
- range = new Range(results.continueKey, !results.skipContinueKey, range.getEndKey(), range.isEndKeyInclusive());
- return new ScanBatch(results.results, true);
+ range = new Range(results.getContinueKey(), !results.isSkipContinueKey(), range.getEndKey(), range.isEndKeyInclusive());
+ return new ScanBatch(results.getResults(), true);
}
} catch (IterationInterruptedException iie) {
@@ -111,13 +111,14 @@ public class Scanner {
} finally {
// code in finally block because always want
// to return mapfiles, even when exception is thrown
- if (!options.isolated)
+ if (!options.isIsolated()) {
dataSource.close(false);
- else
+ } else {
dataSource.detachFileManager();
+ }
- if (results != null && results.results != null)
- tablet.updateQueryStats(results.results.size(), results.numBytes);
+ if (results != null && results.getResults() != null)
+ tablet.updateQueryStats(results.getResults().size(), results.getNumBytes());
}
}
@@ -125,7 +126,7 @@ public class Scanner {
// this could lead to the case where file iterators that are in use by a thread are returned
// to the pool... this would be bad
public void close() {
- options.interruptFlag.set(true);
+ options.getInterruptFlag().set(true);
synchronized (this) {
scanClosed = true;
if (isolatedDataSource != null)
http://git-wip-us.apache.org/repos/asf/accumulo/blob/80498591/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 084503a..ec84aa8 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
@@ -32,13 +32,13 @@ import org.apache.accumulo.server.master.state.TServerInstance;
*
*/
-public class SplitInfo {
- final String dir;
- final SortedMap<FileRef,DataFileValue> datafiles;
- final String time;
- final long initFlushID;
- final long initCompactID;
- final TServerInstance lastLocation;
+final public class SplitInfo {
+ private final String dir;
+ private final SortedMap<FileRef,DataFileValue> datafiles;
+ private final String time;
+ private final long initFlushID;
+ private final long initCompactID;
+ private final TServerInstance lastLocation;
SplitInfo(String d, SortedMap<FileRef,DataFileValue> dfv, String time, long initFlushID, long initCompactID, TServerInstance lastLocation) {
this.dir = d;
@@ -49,4 +49,28 @@ public class SplitInfo {
this.lastLocation = lastLocation;
}
+ public String getDir() {
+ return dir;
+ }
+
+ public SortedMap<FileRef,DataFileValue> getDatafiles() {
+ return datafiles;
+ }
+
+ public String getTime() {
+ return time;
+ }
+
+ public long getInitFlushID() {
+ return initFlushID;
+ }
+
+ public long getInitCompactID() {
+ return initCompactID;
+ }
+
+ public TServerInstance getLastLocation() {
+ return lastLocation;
+ }
+
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/accumulo/blob/80498591/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 432e3a3..bf9a905 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
@@ -255,7 +255,7 @@ public class Tablet implements TabletCommitter {
}
public Tablet(TabletServer tabletServer, KeyExtent extent, TabletResourceManager trm, SplitInfo info) throws IOException {
- this(tabletServer, new Text(info.dir), extent, trm, info.datafiles, info.time, info.initFlushID, info.initCompactID, info.lastLocation);
+ this(tabletServer, new Text(info.getDir()), extent, trm, info.getDatafiles(), info.getTime(), info.getInitFlushID(), info.getInitCompactID(), info.getLastLocation());
splitCreationTime = System.currentTimeMillis();
}
@@ -2539,7 +2539,7 @@ public class Tablet implements TabletCommitter {
minorCompactionWaitingToStart = true;
}
- public void minorCompacationStarted() {
+ public void minorCompactionStarted() {
minorCompactionWaitingToStart = false;
minorCompactionInProgress = true;
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/80498591/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 253c97e..302b025 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
@@ -26,7 +26,6 @@ import org.apache.accumulo.core.data.Key;
import org.apache.accumulo.core.data.Range;
import org.apache.accumulo.core.data.Value;
import org.apache.accumulo.core.iterators.SortedMapIterator;
-import org.apache.accumulo.tserver.tablet.Compactor.CountingIterator;
import org.junit.Assert;
import org.junit.Test;