Skip to content

Commit

Permalink
Merge branch '3.1' into feature-3505
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinrr888 committed Sep 11, 2024
2 parents 62ca388 + 5e09d98 commit 915b6fd
Show file tree
Hide file tree
Showing 252 changed files with 2,290 additions and 775 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ private static String getDefaultErrorMessage(final SecurityErrorCode errorcode)

private String user;
private String tableInfo;
private SecurityErrorCode errorCode;
private final SecurityErrorCode errorCode;

/**
* @return this exception as a thrift exception
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ public class ClientSideIteratorScanner extends ScannerOptions implements Scanner

private class ClientSideIteratorEnvironment implements IteratorEnvironment {

private SamplerConfiguration samplerConfig;
private boolean sampleEnabled;
private final SamplerConfiguration samplerConfig;
private final boolean sampleEnabled;

ClientSideIteratorEnvironment(boolean sampleEnabled, SamplerConfiguration samplerConfig) {
this.sampleEnabled = sampleEnabled;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ public interface ConditionalWriter extends AutoCloseable {
class Result {

private Status status;
private ConditionalMutation mutation;
private String server;
private final ConditionalMutation mutation;
private final String server;
private Exception exception;

public Result(Status s, ConditionalMutation m, String server) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,17 @@ public class IsolatedScanner extends ScannerOptions implements Scanner {
private static class RowBufferingIterator implements Iterator<Entry<Key,Value>> {

private Iterator<Entry<Key,Value>> source;
private RowBuffer buffer;
private final RowBuffer buffer;
private Entry<Key,Value> nextRowStart;
private Iterator<Entry<Key,Value>> rowIter;
private ByteSequence lastRow = null;
private long timeout;
private final long timeout;

private final Scanner scanner;
private ScannerOptions opts;
private Range range;
private int batchSize;
private long readaheadThreshold;
private final ScannerOptions opts;
private final Range range;
private final int batchSize;
private final long readaheadThreshold;

private void readRow() {

Expand Down Expand Up @@ -195,7 +195,7 @@ public RowBuffer newBuffer() {

public static class MemoryRowBuffer implements RowBuffer {

private ArrayList<Entry<Key,Value>> buffer = new ArrayList<>();
private final ArrayList<Entry<Key,Value>> buffer = new ArrayList<>();

@Override
public void add(Entry<Key,Value> entry) {
Expand All @@ -214,11 +214,11 @@ public void clear() {

}

private Scanner scanner;
private final Scanner scanner;
private Range range;
private int batchSize;
private long readaheadThreshold;
private RowBufferFactory bufferFactory;
private final RowBufferFactory bufferFactory;

public IsolatedScanner(Scanner scanner) {
this(scanner, new MemoryRowBufferFactory());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public class IteratorSetting implements Writable {
private int priority;
private String name;
private String iteratorClass;
private Map<String,String> properties;
private final Map<String,String> properties;

/**
* Get layer at which this iterator applies. See {@link #setPriority(int)} for how the priority is
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public class NamespaceNotEmptyException extends Exception {

private static final long serialVersionUID = 1L;

private String namespace;
private final String namespace;

/**
* @param namespaceId the internal id of the namespace
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public class NamespaceNotFoundException extends Exception {
*/
private static final long serialVersionUID = 1L;

private String namespace;
private final String namespace;

/**
* @param namespaceId the internal id of the namespace that was sought
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public class RowIterator implements Iterator<Iterator<Entry<Key,Value>>> {
* Iterate over entries in a single row.
*/
private static class SingleRowIter implements Iterator<Entry<Key,Value>> {
private PeekingIterator<Entry<Key,Value>> source;
private final PeekingIterator<Entry<Key,Value>> source;
private Text currentRow = null;
private long count = 0;
private boolean disabled = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
public class TableDeletedException extends RuntimeException {

private static final long serialVersionUID = 1L;
private String tableId;
private final String tableId;

public TableDeletedException(String tableId) {
super("Table ID " + tableId + " was deleted");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public class TableNotFoundException extends Exception {
*/
private static final long serialVersionUID = 1L;

private String tableName;
private final String tableName;

/**
* @param tableId the internal id of the table that was sought
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,14 @@ Map<String,String> modifyProperties(Consumer<Map<String,String>> mapMutator)
*/
List<String> getManagerLocations();

/**
* Returns the locations of the active compactors
*
* @return A set of currently active compactors.
* @since 2.1.4
*/
Set<String> getCompactors();

/**
* Returns the locations of the active scan servers
*
Expand All @@ -209,13 +217,12 @@ List<ActiveScan> getActiveScans(String tserver)
throws AccumuloException, AccumuloSecurityException;

/**
* List the active compaction running on a tablet server. Using this method with
* {@link #getTabletServers()} will only show compactions running on tservers, leaving out any
* external compactions running on compactors. Use {@link #getActiveCompactions()} to get a list
* of all compactions running on tservers and compactors.
* List the active compaction running on a TabletServer or Compactor. The server address can be
* retrieved using {@link #getCompactors()} or {@link #getTabletServers()}. Use
* {@link #getActiveCompactions()} to get a list of all compactions running on tservers and
* compactors. Implementation updated in 2.1.4 to accept a compactor address.
*
* @param tserver The tablet server address. This should be of the form
* {@code <ip address>:<port>}
* @param tserver The server address. This should be of the form {@code <ip address>:<port>}
* @return the list of active compactions
* @since 1.5.0
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,20 @@
package org.apache.accumulo.core.client.admin;

public enum ScanState {
IDLE, RUNNING, QUEUED
/**
* Indicates no work is currently queued or running to fetch the next batch of key/values for a
* scan. This could be because the server is waiting for a client to retrieve a batch of
* key/values its has already fetched and is buffering.
*/
IDLE,
/**
* Indicates a task is running in a server side thread pool to fetch the next batch of key/values
* for a scan.
*/
RUNNING,
/**
* Indicates a task is queued in a server side thread pool to fetch the next bach of key/values
* for a scan.
*/
QUEUED
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
*/
public class DateLexicoder extends AbstractLexicoder<Date> {

private LongLexicoder longEncoder = new LongLexicoder();
private final LongLexicoder longEncoder = new LongLexicoder();

@Override
public byte[] encode(Date data) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
*/
public class DoubleLexicoder extends AbstractLexicoder<Double> {

private ULongLexicoder longEncoder = new ULongLexicoder();
private final ULongLexicoder longEncoder = new ULongLexicoder();

@Override
public byte[] encode(Double d) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
*/
public class FloatLexicoder extends AbstractLexicoder<Float> {

private UIntegerLexicoder intEncoder = new UIntegerLexicoder();
private final UIntegerLexicoder intEncoder = new UIntegerLexicoder();

@Override
public byte[] encode(Float f) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
*/
public class IntegerLexicoder extends AbstractLexicoder<Integer> {

private UIntegerLexicoder uil = new UIntegerLexicoder();
private final UIntegerLexicoder uil = new UIntegerLexicoder();

@Override
public byte[] encode(Integer i) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
*/
public class ListLexicoder<LT> extends AbstractLexicoder<List<LT>> {

private Lexicoder<LT> lexicoder;
private final Lexicoder<LT> lexicoder;

public ListLexicoder(Lexicoder<LT> lexicoder) {
this.lexicoder = lexicoder;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@
public class PairLexicoder<A extends Comparable<A>,B extends Comparable<B>>
extends AbstractLexicoder<ComparablePair<A,B>> {

private Lexicoder<A> firstLexicoder;
private Lexicoder<B> secondLexicoder;
private final Lexicoder<A> firstLexicoder;
private final Lexicoder<B> secondLexicoder;

public PairLexicoder(Lexicoder<A> firstLexicoder, Lexicoder<B> secondLexicoder) {
this.firstLexicoder = firstLexicoder;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
*/
public class ReverseLexicoder<T> extends AbstractLexicoder<T> {

private Lexicoder<T> lexicoder;
private final Lexicoder<T> lexicoder;

/**
* @param lexicoder The lexicoder who's sort order will be flipped.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,11 @@ class RFileScanner extends ScannerOptions implements Scanner {
private BlockCacheManager blockCacheManager = null;
private BlockCache dataCache = null;
private BlockCache indexCache = null;
private Opts opts;
private final Opts opts;
private int batchSize = 1000;
private long readaheadThreshold = 3;
private AccumuloConfiguration tableConf;
private CryptoService cryptoService;
private final AccumuloConfiguration tableConf;
private final CryptoService cryptoService;

static class Opts {
InputArgs in;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ RFileSource[] getSources() throws IOException {
}
}

private RFileScanner.Opts opts = new RFileScanner.Opts();
private final RFileScanner.Opts opts = new RFileScanner.Opts();

@Override
public ScannerOptions withoutSystemIterators() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
*/
public class RFileWriter implements AutoCloseable {

private FileSKVWriter writer;
private final FileSKVWriter writer;
private final LRUMap<ByteSequence,Boolean> validVisibilities;
private boolean startedLG;
private boolean startedDefaultLG;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
*/
public class SamplerConfiguration {

private String className;
private final String className;
private Map<String,String> options = new HashMap<>();

public SamplerConfiguration(Class<? extends Sampler> samplerClass) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ public static byte[] serialize(AuthenticationToken token) {
class Properties implements Destroyable, Map<String,char[]> {

private boolean destroyed = false;
private HashMap<String,char[]> map = new HashMap<>();
private final HashMap<String,char[]> map = new HashMap<>();

private void checkDestroyed() {
if (destroyed) {
Expand Down Expand Up @@ -241,8 +241,9 @@ public Set<Map.Entry<String,char[]>> entrySet() {
}

class TokenProperty implements Comparable<TokenProperty> {
private String key, description;
private boolean masked;
private final String key;
private final String description;
private final boolean masked;

public TokenProperty(String name, String description, boolean mask) {
this.key = name;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,15 +218,15 @@ public Collector collector(SummarizerConfiguration sc) {
// efficient than converting String for each Key. The
// conversion to String is deferred until the summary is requested.

private Map<K,MutableLong> counters = new HashMap<>();
private final Map<K,MutableLong> counters = new HashMap<>();
private long tooMany = 0;
private long tooLong = 0;
private long seen = 0;
private long emitted = 0;
private long deleted = 0;
private Converter<K> converter = converter();
private Function<K,String> encoder = encoder();
private UnaryOperator<K> copier = copier();
private final Converter<K> converter = converter();
private final Function<K,String> encoder = encoder();
private final UnaryOperator<K> copier = copier();

private void incrementCounter(K counter) {
emitted++;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ protected Converter<ByteSequence> converter() {
private static class AuthsConverter implements Converter<ByteSequence> {

final int MAX_ENTRIES = 1000;
private Map<ByteSequence,Set<ByteSequence>> cache =
private final Map<ByteSequence,Set<ByteSequence>> cache =
new LinkedHashMap<>(MAX_ENTRIES + 1, .75F, true) {
private static final long serialVersionUID = 1L;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ private static class LengthStats {
private long min = Long.MAX_VALUE;
private long max = Long.MIN_VALUE;
private long sum = 0;
private long[] counts = new long[32];
private final long[] counts = new long[32];

private void accept(int length) {
int idx;
Expand Down Expand Up @@ -106,12 +106,12 @@ private static void merge(String prefix, Map<String,Long> stats1, Map<String,Lon
public Collector collector(SummarizerConfiguration sc) {
return new Collector() {

private LengthStats keyStats = new LengthStats();
private LengthStats rowStats = new LengthStats();
private LengthStats familyStats = new LengthStats();
private LengthStats qualifierStats = new LengthStats();
private LengthStats visibilityStats = new LengthStats();
private LengthStats valueStats = new LengthStats();
private final LengthStats keyStats = new LengthStats();
private final LengthStats rowStats = new LengthStats();
private final LengthStats familyStats = new LengthStats();
private final LengthStats qualifierStats = new LengthStats();
private final LengthStats visibilityStats = new LengthStats();
private final LengthStats valueStats = new LengthStats();
private long total = 0;

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@
*/
public class ActiveCompactionImpl extends ActiveCompaction {

private org.apache.accumulo.core.tabletserver.thrift.ActiveCompaction tac;
private ClientContext context;
private HostAndPort hostport;
private Type type;
private final org.apache.accumulo.core.tabletserver.thrift.ActiveCompaction tac;
private final ClientContext context;
private final HostAndPort hostport;
private final Type type;

ActiveCompactionImpl(ClientContext context,
org.apache.accumulo.core.tabletserver.thrift.ActiveCompaction tac, HostAndPort hostport,
Expand Down
Loading

0 comments on commit 915b6fd

Please sign in to comment.