Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@ class OfflineIterator implements Iterator<Entry<Key,Value>> {
static class OfflineIteratorEnvironment implements IteratorEnvironment {

private final Authorizations authorizations;
private AccumuloConfiguration conf;
private boolean useSample;
private SamplerConfiguration sampleConf;
private final AccumuloConfiguration conf;
private final boolean useSample;
private final SamplerConfiguration sampleConf;

public OfflineIteratorEnvironment(Authorizations auths, AccumuloConfiguration acuTableConf,
boolean useSample, SamplerConfiguration samplerConf) {
Expand Down Expand Up @@ -109,7 +109,8 @@ public boolean isUserCompaction() {
return false;
}

private ArrayList<SortedKeyValueIterator<Key,Value>> topLevelIterators = new ArrayList<>();
private final ArrayList<SortedKeyValueIterator<Key,Value>> topLevelIterators =
new ArrayList<>();

@Deprecated(since = "2.0.0")
@Override
Expand Down Expand Up @@ -151,11 +152,11 @@ public IteratorEnvironment cloneWithSamplingEnabled() {
private SortedKeyValueIterator<Key,Value> iter;
private Range range;
private KeyExtent currentExtent;
private TableId tableId;
private Authorizations authorizations;
private ClientContext context;
private ScannerOptions options;
private ArrayList<SortedKeyValueIterator<Key,Value>> readers;
private final TableId tableId;
private final Authorizations authorizations;
private final ClientContext context;
private final ScannerOptions options;
private final ArrayList<SortedKeyValueIterator<Key,Value>> readers;

public OfflineIterator(ScannerOptions options, ClientContext context,
Authorizations authorizations, Text table, Range range) {
Expand Down Expand Up @@ -210,7 +211,7 @@ public Entry<Key,Value> next() {

private void nextTablet() throws TableNotFoundException, AccumuloException, IOException {

Range nextRange = null;
Range nextRange;

if (currentExtent == null) {
Text startRow;
Expand All @@ -223,12 +224,8 @@ private void nextTablet() throws TableNotFoundException, AccumuloException, IOEx
nextRange = new Range(TabletsSection.encodeRow(tableId, startRow), true, null, false);
} else {

if (currentExtent.endRow() == null) {
iter = null;
return;
}

if (range.afterEndKey(new Key(currentExtent.endRow()).followingKey(PartialKey.ROW))) {
if (currentExtent.endRow() == null
|| range.afterEndKey(new Key(currentExtent.endRow()).followingKey(PartialKey.ROW))) {
iter = null;
return;
}
Expand Down Expand Up @@ -279,8 +276,6 @@ private SortedKeyValueIterator<Key,Value> createIterator(KeyExtent extent,
Collection<StoredTabletFile> absFiles)
throws TableNotFoundException, AccumuloException, IOException {

// TODO share code w/ tablet - ACCUMULO-1303

// possible race condition here, if table is renamed
String tableName = Tables.getTableName(context, tableId);
AccumuloConfiguration acuTableConf =
Expand All @@ -300,13 +295,9 @@ private SortedKeyValueIterator<Key,Value> createIterator(KeyExtent extent,
SamplerConfigurationImpl samplerConfImpl =
SamplerConfigurationImpl.newSamplerConfig(acuTableConf);

if (scannerSamplerConfigImpl != null
&& ((samplerConfImpl != null && !scannerSamplerConfigImpl.equals(samplerConfImpl))
|| samplerConfImpl == null)) {
if (scannerSamplerConfigImpl != null && !scannerSamplerConfigImpl.equals(samplerConfImpl)) {
throw new SampleNotPresentException();
}

// TODO need to close files - ACCUMULO-1303
for (TabletFile file : absFiles) {
FileSystem fs = VolumeConfiguration.fileSystemForPath(file.getPathStr(), conf);
FileSKVIterator reader = FileOperations.getInstance().newReaderBuilder()
Expand Down