accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ctubb...@apache.org
Subject git commit: ACCUMULO-3204 Remove old, unused classes
Date Mon, 06 Oct 2014 22:53:33 GMT
Repository: accumulo
Updated Branches:
  refs/heads/master 4ce6ee907 -> f4cf6e6e4


ACCUMULO-3204 Remove old, unused classes


Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/f4cf6e6e
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/f4cf6e6e
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/f4cf6e6e

Branch: refs/heads/master
Commit: f4cf6e6e43f290bd1adf1eecdefe4b29f0a0012a
Parents: 4ce6ee9
Author: Christopher Tubbs <ctubbsii@apache.org>
Authored: Fri Oct 3 21:20:28 2014 -0400
Committer: Christopher Tubbs <ctubbsii@apache.org>
Committed: Mon Oct 6 15:26:05 2014 -0400

----------------------------------------------------------------------
 .../file/blockfile/cache/SimpleBlockCache.java  | 122 --------------
 .../bcfile/BoundedByteArrayOutputStream.java    |  94 -----------
 .../core/file/rfile/bcfile/ByteArray.java       |  89 -----------
 .../core/master/MasterNotRunningException.java  |  35 -----
 .../core/trace/InstanceUserPassword.java        |  33 ----
 .../apache/accumulo/core/util/BinaryTree.java   |  85 ----------
 .../accumulo/core/util/BulkImportHelper.java    |  27 ----
 .../core/util/ByteArrayBackedCharSequence.java  |  71 ---------
 .../org/apache/accumulo/core/util/Merge.java    |  59 +++----
 .../master/balancer/DefaultLoadBalancer.java    |  63 ++++----
 .../accumulo/master/TServerLockWatcher.java     |  43 -----
 .../accumulo/tserver/EndOfTableException.java   |  26 ---
 .../accumulo/tserver/TabletServerConstants.java |  28 ----
 .../apache/accumulo/tserver/tablet/Tablet.java  | 157 ++++++++++---------
 14 files changed, 138 insertions(+), 794 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/f4cf6e6e/core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/SimpleBlockCache.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/SimpleBlockCache.java b/core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/SimpleBlockCache.java
deleted file mode 100644
index c00061a..0000000
--- a/core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/SimpleBlockCache.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- * 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.core.file.blockfile.cache;
-
-import java.lang.ref.ReferenceQueue;
-import java.lang.ref.SoftReference;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * Simple one RFile soft reference cache.
- */
-public class SimpleBlockCache implements BlockCache {
-  
-  private static class SimpleCacheEntry implements CacheEntry {
-    
-    private byte[] buffer;
-    private Object index;
-    
-    SimpleCacheEntry(byte[] buffer) {
-      this.buffer = buffer;
-    }
-    
-    @Override
-    public byte[] getBuffer() {
-      return buffer;
-    }
-    
-    @Override
-    public Object getIndex() {
-      return index;
-    }
-    
-    @Override
-    public void setIndex(Object idx) {
-      this.index = idx;
-    }
-    
-  }
-  
-  private static class Ref extends SoftReference<SimpleCacheEntry> {
-    public String blockId;
-    
-    public Ref(String blockId, SimpleCacheEntry sce, ReferenceQueue<SimpleCacheEntry> q) {
-      super(sce, q);
-      this.blockId = blockId;
-    }
-  }
-  
-  private Map<String,Ref> cache = new HashMap<String,Ref>();
-  
-  private ReferenceQueue<SimpleCacheEntry> q = new ReferenceQueue<SimpleCacheEntry>();
-  public int dumps = 0;
-  
-  /**
-   * Constructor
-   */
-  public SimpleBlockCache() {
-    super();
-  }
-  
-  void processQueue() {
-    Ref r;
-    while ((r = (Ref) q.poll()) != null) {
-      cache.remove(r.blockId);
-      dumps++;
-    }
-  }
-  
-  /**
-   * @return the size
-   */
-  public synchronized int size() {
-    processQueue();
-    return cache.size();
-  }
-  
-  public synchronized SimpleCacheEntry getBlock(String blockName) {
-    processQueue(); // clear out some crap.
-    Ref ref = cache.get(blockName);
-    if (ref == null)
-      return null;
-    return ref.get();
-  }
-  
-  public synchronized SimpleCacheEntry cacheBlock(String blockName, byte buf[]) {
-    SimpleCacheEntry sce = new SimpleCacheEntry(buf);
-    cache.put(blockName, new Ref(blockName, sce, q));
-    return sce;
-  }
-  
-  public synchronized SimpleCacheEntry cacheBlock(String blockName, byte buf[], boolean inMemory) {
-    SimpleCacheEntry sce = new SimpleCacheEntry(buf);
-    cache.put(blockName, new Ref(blockName, sce, q));
-    return sce;
-  }
-  
-  public void shutdown() {
-    // noop
-  }
-  
-  @Override
-  public long getMaxSize() {
-    return Long.MAX_VALUE;
-  }
-}

http://git-wip-us.apache.org/repos/asf/accumulo/blob/f4cf6e6e/core/src/main/java/org/apache/accumulo/core/file/rfile/bcfile/BoundedByteArrayOutputStream.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/file/rfile/bcfile/BoundedByteArrayOutputStream.java b/core/src/main/java/org/apache/accumulo/core/file/rfile/bcfile/BoundedByteArrayOutputStream.java
deleted file mode 100644
index 54305c8..0000000
--- a/core/src/main/java/org/apache/accumulo/core/file/rfile/bcfile/BoundedByteArrayOutputStream.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * 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.core.file.rfile.bcfile;
-
-import java.io.EOFException;
-import java.io.IOException;
-import java.io.OutputStream;
-
-/**
- * A byte array backed output stream with a limit. The limit should be smaller than the buffer capacity. The object can be reused through <code>reset</code> API
- * and choose different limits in each round.
- */
-class BoundedByteArrayOutputStream extends OutputStream {
-  private final byte[] buffer;
-  private int limit;
-  private int count;
-  
-  public BoundedByteArrayOutputStream(int capacity) {
-    this(capacity, capacity);
-  }
-  
-  public BoundedByteArrayOutputStream(int capacity, int limit) {
-    if ((capacity < limit) || (capacity | limit) < 0) {
-      throw new IllegalArgumentException("Invalid capacity/limit");
-    }
-    this.buffer = new byte[capacity];
-    this.limit = limit;
-    this.count = 0;
-  }
-  
-  @Override
-  public void write(int b) throws IOException {
-    if (count >= limit) {
-      throw new EOFException("Reaching the limit of the buffer.");
-    }
-    buffer[count++] = (byte) b;
-  }
-  
-  @Override
-  public void write(byte b[], int off, int len) throws IOException {
-    if ((off < 0) || (off > b.length) || (len < 0) || ((off + len) > b.length) || ((off + len) < 0)) {
-      throw new IndexOutOfBoundsException();
-    } else if (len == 0) {
-      return;
-    }
-    
-    if (count + len > limit) {
-      throw new EOFException("Reach the limit of the buffer");
-    }
-    
-    System.arraycopy(b, off, buffer, count, len);
-    count += len;
-  }
-  
-  public void reset(int newlim) {
-    if (newlim > buffer.length) {
-      throw new IndexOutOfBoundsException("Limit exceeds buffer size");
-    }
-    this.limit = newlim;
-    this.count = 0;
-  }
-  
-  public void reset() {
-    this.limit = buffer.length;
-    this.count = 0;
-  }
-  
-  public int getLimit() {
-    return limit;
-  }
-  
-  public byte[] getBuffer() {
-    return buffer;
-  }
-  
-  public int size() {
-    return count;
-  }
-}

http://git-wip-us.apache.org/repos/asf/accumulo/blob/f4cf6e6e/core/src/main/java/org/apache/accumulo/core/file/rfile/bcfile/ByteArray.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/file/rfile/bcfile/ByteArray.java b/core/src/main/java/org/apache/accumulo/core/file/rfile/bcfile/ByteArray.java
deleted file mode 100644
index d7734a2..0000000
--- a/core/src/main/java/org/apache/accumulo/core/file/rfile/bcfile/ByteArray.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * 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.core.file.rfile.bcfile;
-
-import org.apache.hadoop.io.BytesWritable;
-
-/**
- * Adaptor class to wrap byte-array backed objects (including java byte array) as RawComparable objects.
- */
-public final class ByteArray implements RawComparable {
-  private final byte[] buffer;
-  private final int offset;
-  private final int len;
-  
-  /**
-   * Constructing a ByteArray from a {@link BytesWritable}.
-   */
-  public ByteArray(BytesWritable other) {
-    this(other.getBytes(), 0, other.getLength());
-  }
-  
-  /**
-   * Wrap a whole byte array as a RawComparable.
-   * 
-   * @param buffer
-   *          the byte array buffer.
-   */
-  public ByteArray(byte[] buffer) {
-    this(buffer, 0, buffer.length);
-  }
-  
-  /**
-   * Wrap a partial byte array as a RawComparable.
-   * 
-   * @param buffer
-   *          the byte array buffer.
-   * @param offset
-   *          the starting offset
-   * @param len
-   *          the length of the consecutive bytes to be wrapped.
-   */
-  public ByteArray(byte[] buffer, int offset, int len) {
-    if ((offset | len | (buffer.length - offset - len)) < 0) {
-      throw new IndexOutOfBoundsException();
-    }
-    this.buffer = buffer;
-    this.offset = offset;
-    this.len = len;
-  }
-  
-  /**
-   * @return the underlying buffer.
-   */
-  @Override
-  public byte[] buffer() {
-    return buffer;
-  }
-  
-  /**
-   * @return the offset in the buffer.
-   */
-  @Override
-  public int offset() {
-    return offset;
-  }
-  
-  /**
-   * @return the size of the byte array.
-   */
-  @Override
-  public int size() {
-    return len;
-  }
-}

http://git-wip-us.apache.org/repos/asf/accumulo/blob/f4cf6e6e/core/src/main/java/org/apache/accumulo/core/master/MasterNotRunningException.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/master/MasterNotRunningException.java b/core/src/main/java/org/apache/accumulo/core/master/MasterNotRunningException.java
deleted file mode 100644
index 1b5361f..0000000
--- a/core/src/main/java/org/apache/accumulo/core/master/MasterNotRunningException.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * 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.core.master;
-
-public class MasterNotRunningException extends Exception {
-  
-  /**
-   * eclipse generated this ...
-   */
-  private static final long serialVersionUID = 1L;
-  private String message;
-  
-  public MasterNotRunningException(String msg) {
-    message = msg;
-  }
-  
-  public String getMessage() {
-    return message;
-  }
-  
-}

http://git-wip-us.apache.org/repos/asf/accumulo/blob/f4cf6e6e/core/src/main/java/org/apache/accumulo/core/trace/InstanceUserPassword.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/trace/InstanceUserPassword.java b/core/src/main/java/org/apache/accumulo/core/trace/InstanceUserPassword.java
deleted file mode 100644
index 2ce229c..0000000
--- a/core/src/main/java/org/apache/accumulo/core/trace/InstanceUserPassword.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * 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.core.trace;
-
-import java.nio.charset.StandardCharsets;
-
-import org.apache.accumulo.core.client.Instance;
-
-public class InstanceUserPassword {
-  public Instance instance;
-  public String username;
-  public byte[] password;
-  
-  public InstanceUserPassword(Instance instance, String username, String password) {
-    this.instance = instance;
-    this.username = username;
-    this.password = password.getBytes(StandardCharsets.UTF_8);
-  }
-}

http://git-wip-us.apache.org/repos/asf/accumulo/blob/f4cf6e6e/core/src/main/java/org/apache/accumulo/core/util/BinaryTree.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/util/BinaryTree.java b/core/src/main/java/org/apache/accumulo/core/util/BinaryTree.java
deleted file mode 100644
index 0dbab6d..0000000
--- a/core/src/main/java/org/apache/accumulo/core/util/BinaryTree.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * 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.core.util;
-
-/**
- * A class for storing data as a binary tree. This class does not implement Collection as several methods such as add are not appropriate.
- * 
- * A tree is represented as a node with a parent, a left child, and a right child. If the parent is null, this node represents the root of the tree. A node has
- * contents of type T.
- * 
- */
-
-public class BinaryTree<T> {
-  private BinaryTree<T> parent;
-  private BinaryTree<T> left;
-  private BinaryTree<T> right;
-  
-  T contents;
-  
-  public BinaryTree<T> getLeft() {
-    return left;
-  }
-  
-  public void setLeft(BinaryTree<T> left) {
-    left.setParent(this);
-    this.left = left;
-  }
-  
-  public BinaryTree<T> getParent() {
-    return parent;
-  }
-  
-  public void setParent(BinaryTree<T> parent) {
-    this.parent = parent;
-  }
-  
-  public BinaryTree<T> getRight() {
-    return right;
-  }
-  
-  public void setRight(BinaryTree<T> right) {
-    right.setParent(this);
-    this.right = right;
-  }
-  
-  public T getContents() {
-    return contents;
-  }
-  
-  public void setContents(T contents) {
-    this.contents = contents;
-  }
-  
-  public boolean isEmpty() {
-    if (parent == null && left == null && right == null && contents == null)
-      return true;
-    return false;
-  }
-  
-  @Override
-  public String toString() {
-    String out = "[";
-    if (left != null)
-      out += left.toString();
-    out += contents;
-    if (right != null)
-      out += right.toString();
-    out += "]";
-    return out;
-  }
-}

http://git-wip-us.apache.org/repos/asf/accumulo/blob/f4cf6e6e/core/src/main/java/org/apache/accumulo/core/util/BulkImportHelper.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/util/BulkImportHelper.java b/core/src/main/java/org/apache/accumulo/core/util/BulkImportHelper.java
deleted file mode 100644
index 97459ff..0000000
--- a/core/src/main/java/org/apache/accumulo/core/util/BulkImportHelper.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * 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.core.util;
-
-public class BulkImportHelper {
-  public static class AssignmentStats {
-    public AssignmentStats() {}
-    
-    public String toString() {
-      return "Bulk Import no longer provides statistics";
-    }
-  }
-}

http://git-wip-us.apache.org/repos/asf/accumulo/blob/f4cf6e6e/core/src/main/java/org/apache/accumulo/core/util/ByteArrayBackedCharSequence.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/util/ByteArrayBackedCharSequence.java b/core/src/main/java/org/apache/accumulo/core/util/ByteArrayBackedCharSequence.java
deleted file mode 100644
index b3ebae4..0000000
--- a/core/src/main/java/org/apache/accumulo/core/util/ByteArrayBackedCharSequence.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * 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.core.util;
-
-import java.nio.charset.StandardCharsets;
-
-import org.apache.accumulo.core.data.ByteSequence;
-
-public class ByteArrayBackedCharSequence implements CharSequence {
-  
-  private byte[] data;
-  private int offset;
-  private int len;
-  
-  public ByteArrayBackedCharSequence(byte[] data, int offset, int len) {
-    this.data = data;
-    this.offset = offset;
-    this.len = len;
-  }
-  
-  public ByteArrayBackedCharSequence(byte[] data) {
-    this(data, 0, data.length);
-  }
-  
-  public ByteArrayBackedCharSequence() {
-    this(null, 0, 0);
-  }
-  
-  public void set(byte[] data, int offset, int len) {
-    this.data = data;
-    this.offset = offset;
-    this.len = len;
-  }
-  
-  @Override
-  public char charAt(int index) {
-    return (char) (0xff & data[offset + index]);
-  }
-  
-  @Override
-  public int length() {
-    return len;
-  }
-  
-  @Override
-  public CharSequence subSequence(int start, int end) {
-    return new ByteArrayBackedCharSequence(data, offset + start, end - start);
-  }
-  
-  public String toString() {
-    return new String(data, offset, len, StandardCharsets.UTF_8);
-  }
-  
-  public void set(ByteSequence bs) {
-    set(bs.getBackingArray(), bs.offset(), bs.length());
-  }
-}

http://git-wip-us.apache.org/repos/asf/accumulo/blob/f4cf6e6e/core/src/main/java/org/apache/accumulo/core/util/Merge.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/util/Merge.java b/core/src/main/java/org/apache/accumulo/core/util/Merge.java
index 4bb6ed3..167933f 100644
--- a/core/src/main/java/org/apache/accumulo/core/util/Merge.java
+++ b/core/src/main/java/org/apache/accumulo/core/util/Merge.java
@@ -43,35 +43,28 @@ import com.beust.jcommander.IStringConverter;
 import com.beust.jcommander.Parameter;
 
 public class Merge {
-  
+
   public static class MergeException extends Exception {
     private static final long serialVersionUID = 1L;
-    
+
     MergeException(Exception ex) {
       super(ex);
     }
   };
-  
+
   private static final Logger log = Logger.getLogger(Merge.class);
-  
+
   protected void message(String format, Object... args) {
     log.info(String.format(format, args));
   }
-  
-  static class MemoryConverter implements IStringConverter<Long> {
-    @Override
-    public Long convert(String value) {
-      return AccumuloConfiguration.getMemoryInBytes(value);
-    }
-  }
-  
+
   static class TextConverter implements IStringConverter<Text> {
     @Override
     public Text convert(String value) {
       return new Text(value);
     }
   }
-  
+
   static class Opts extends ClientOnRequiredTable {
     @Parameter(names = {"-s", "--size"}, description = "merge goal size", converter = MemoryConverter.class)
     Long goalSize = null;
@@ -82,14 +75,14 @@ public class Merge {
     @Parameter(names = {"-e", "--end"}, description = "end tablet", converter = TextConverter.class)
     Text end = null;
   }
-  
+
   public void start(String[] args) throws MergeException {
     Opts opts = new Opts();
     opts.parseArgs(Merge.class.getName(), args);
-    
+
     try {
       Connector conn = opts.getConnector();
-      
+
       if (!conn.tableOperations().exists(opts.getTableName())) {
         System.err.println("table " + opts.getTableName() + " does not exist");
         return;
@@ -98,29 +91,29 @@ public class Merge {
         AccumuloConfiguration tableConfig = new ConfigurationCopy(conn.tableOperations().getProperties(opts.getTableName()));
         opts.goalSize = tableConfig.getMemoryInBytes(Property.TABLE_SPLIT_THRESHOLD);
       }
-      
+
       message("Merging tablets in table %s to %d bytes", opts.getTableName(), opts.goalSize);
       mergomatic(conn, opts.getTableName(), opts.begin, opts.end, opts.goalSize, opts.force);
     } catch (Exception ex) {
       throw new MergeException(ex);
     }
   }
-  
+
   public static void main(String[] args) throws MergeException {
     Merge merge = new Merge();
     merge.start(args);
   }
-  
+
   public static class Size {
     public Size(KeyExtent extent, long size) {
       this.extent = extent;
       this.size = size;
     }
-    
+
     KeyExtent extent;
     long size;
   }
-  
+
   public void mergomatic(Connector conn, String table, Text start, Text end, long goalSize, boolean force) throws MergeException {
     try {
       if (table.equals(MetadataTable.NAME)) {
@@ -144,7 +137,7 @@ public class Merge {
       throw new MergeException(ex);
     }
   }
-  
+
   protected long mergeMany(Connector conn, String table, List<Size> sizes, long goalSize, boolean force, boolean last) throws MergeException {
     // skip the big tablets, which will be the typical case
     while (!sizes.isEmpty()) {
@@ -155,7 +148,7 @@ public class Merge {
     if (sizes.isEmpty()) {
       return 0;
     }
-    
+
     // collect any small ones
     long mergeSize = 0;
     int numToMerge = 0;
@@ -166,7 +159,7 @@ public class Merge {
       }
       mergeSize += sizes.get(i).size;
     }
-    
+
     if (numToMerge > 1) {
       mergeSome(conn, table, sizes, numToMerge);
     } else {
@@ -189,14 +182,14 @@ public class Merge {
     }
     return result;
   }
-  
+
   protected void mergeSome(Connector conn, String table, List<Size> sizes, int numToMerge) throws MergeException {
     merge(conn, table, sizes, numToMerge);
     for (int i = 0; i < numToMerge; i++) {
       sizes.remove(0);
     }
   }
-  
+
   protected void merge(Connector conn, String table, List<Size> sizes, int numToMerge) throws MergeException {
     try {
       Text start = sizes.get(0).extent.getPrevEndRow();
@@ -207,7 +200,7 @@ public class Merge {
       throw new MergeException(ex);
     }
   }
-  
+
   protected Iterator<Size> getSizeIterator(Connector conn, String tablename, Text start, Text end) throws MergeException {
     // open up metatadata, walk through the tablets.
     String tableId;
@@ -222,15 +215,15 @@ public class Merge {
     scanner.fetchColumnFamily(DataFileColumnFamily.NAME);
     TabletsSection.TabletColumnFamily.PREV_ROW_COLUMN.fetch(scanner);
     final Iterator<Entry<Key,Value>> iterator = scanner.iterator();
-    
+
     Iterator<Size> result = new Iterator<Size>() {
       Size next = fetch();
-      
+
       @Override
       public boolean hasNext() {
         return next != null;
       }
-      
+
       private Size fetch() {
         long tabletSize = 0;
         while (iterator.hasNext()) {
@@ -248,14 +241,14 @@ public class Merge {
         }
         return null;
       }
-      
+
       @Override
       public Size next() {
         Size result = next;
         next = fetch();
         return result;
       }
-      
+
       @Override
       public void remove() {
         throw new UnsupportedOperationException();
@@ -263,5 +256,5 @@ public class Merge {
     };
     return result;
   }
-  
+
 }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/f4cf6e6e/server/base/src/main/java/org/apache/accumulo/server/master/balancer/DefaultLoadBalancer.java
----------------------------------------------------------------------
diff --git a/server/base/src/main/java/org/apache/accumulo/server/master/balancer/DefaultLoadBalancer.java b/server/base/src/main/java/org/apache/accumulo/server/master/balancer/DefaultLoadBalancer.java
index ed32e3a..2e4b39d 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/master/balancer/DefaultLoadBalancer.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/master/balancer/DefaultLoadBalancer.java
@@ -35,31 +35,31 @@ import org.apache.accumulo.server.master.state.TabletMigration;
 import org.apache.log4j.Logger;
 
 public class DefaultLoadBalancer extends TabletBalancer {
-  
+
   private static final Logger log = Logger.getLogger(DefaultLoadBalancer.class);
-  
+
   Iterator<TServerInstance> assignments;
   // if tableToBalance is set, then only balance the given table
   String tableToBalance = null;
-  
+
   public DefaultLoadBalancer() {
-    
+
   }
-  
+
   public DefaultLoadBalancer(String table) {
     tableToBalance = table;
   }
-  
+
   List<TServerInstance> randomize(Set<TServerInstance> locations) {
     List<TServerInstance> result = new ArrayList<TServerInstance>(locations);
     Collections.shuffle(result);
     return result;
   }
-  
+
   public TServerInstance getAssignment(SortedMap<TServerInstance,TabletServerStatus> locations, KeyExtent extent, TServerInstance last) {
     if (locations.size() == 0)
       return null;
-    
+
     if (last != null) {
       // Maintain locality
       String fakeSessionID = " ";
@@ -71,7 +71,7 @@ public class DefaultLoadBalancer extends TabletBalancer {
           return current;
       }
     }
-    
+
     // The strategy here is to walk through the locations and hand them back, one at a time
     // Grab an iterator off of the set of options; use a new iterator if it hands back something not in the current list.
     if (assignments == null || !assignments.hasNext())
@@ -83,18 +83,19 @@ public class DefaultLoadBalancer extends TabletBalancer {
     }
     return result;
   }
-  
+
   static class ServerCounts implements Comparable<ServerCounts> {
     public final TServerInstance server;
     public int count;
     public final TabletServerStatus status;
-    
+
     ServerCounts(int count, TServerInstance server, TabletServerStatus status) {
       this.count = count;
       this.server = server;
       this.status = status;
     }
-    
+
+    @Override
     public int compareTo(ServerCounts obj) {
       int result = count - obj.count;
       if (result == 0)
@@ -102,7 +103,7 @@ public class DefaultLoadBalancer extends TabletBalancer {
       return result;
     }
   }
-  
+
   public boolean getMigrations(Map<TServerInstance,TabletServerStatus> current, List<TabletMigration> result) {
     boolean moreBalancingNeeded = false;
     try {
@@ -111,7 +112,7 @@ public class DefaultLoadBalancer extends TabletBalancer {
         return false;
       }
       final Map<String,Map<KeyExtent,TabletStats>> donerTabletStats = new HashMap<String,Map<KeyExtent,TabletStats>>();
-      
+
       // Sort by total number of online tablets, per server
       int total = 0;
       ArrayList<ServerCounts> totals = new ArrayList<ServerCounts>();
@@ -129,13 +130,13 @@ public class DefaultLoadBalancer extends TabletBalancer {
         totals.add(new ServerCounts(serverTotal, entry.getKey(), entry.getValue()));
         total += serverTotal;
       }
-      
+
       // order from low to high
       Collections.sort(totals);
       Collections.reverse(totals);
       int even = total / totals.size();
       int numServersOverEven = total % totals.size();
-      
+
       // Move tablets from the servers with too many to the servers with
       // the fewest but only nominate tablets to move once. This allows us
       // to fill new servers with tablets from a mostly balanced server
@@ -172,36 +173,26 @@ public class DefaultLoadBalancer extends TabletBalancer {
           donerTabletStats.clear();
         }
       }
-      
+
     } finally {
       log.debug("balance ended with " + result.size() + " migrations");
     }
     return moreBalancingNeeded;
   }
-  
-  static class TableDiff {
-    int diff;
-    String table;
-    
-    public TableDiff(int diff, String table) {
-      this.diff = diff;
-      this.table = table;
-    }
-  };
-  
+
   /**
    * Select a tablet based on differences between table loads; if the loads are even, use the busiest table
    */
   List<TabletMigration> move(ServerCounts tooMuch, ServerCounts tooLittle, int count, Map<String,Map<KeyExtent,TabletStats>> donerTabletStats) {
-    
+
     List<TabletMigration> result = new ArrayList<TabletMigration>();
     if (count == 0)
       return result;
-    
+
     // Copy counts so we can update them as we propose migrations
     Map<String,Integer> tooMuchMap = tabletCountsPerTable(tooMuch.status);
     Map<String,Integer> tooLittleMap = tabletCountsPerTable(tooLittle.status);
-    
+
     for (int i = 0; i < count; i++) {
       String table;
       Integer tooLittleCount;
@@ -261,7 +252,7 @@ public class DefaultLoadBalancer extends TabletBalancer {
     }
     return result;
   }
-  
+
   static Map<String,Integer> tabletCountsPerTable(TabletServerStatus status) {
     Map<String,Integer> result = new HashMap<String,Integer>();
     if (status != null && status.tableMap != null) {
@@ -272,7 +263,7 @@ public class DefaultLoadBalancer extends TabletBalancer {
     }
     return result;
   }
-  
+
   static KeyExtent selectTablet(TServerInstance tserver, Map<KeyExtent,TabletStats> extents) {
     if (extents.size() == 0)
       return null;
@@ -285,7 +276,7 @@ public class DefaultLoadBalancer extends TabletBalancer {
       }
     return mostRecentlySplit;
   }
-  
+
   // define what it means for a tablet to be busy
   private static String busiest(Map<String,TableInfo> tables) {
     String result = null;
@@ -300,7 +291,7 @@ public class DefaultLoadBalancer extends TabletBalancer {
     }
     return result;
   }
-  
+
   @Override
   public void getAssignments(SortedMap<TServerInstance,TabletServerStatus> current, Map<KeyExtent,TServerInstance> unassigned,
       Map<KeyExtent,TServerInstance> assignments) {
@@ -331,5 +322,5 @@ public class DefaultLoadBalancer extends TabletBalancer {
     }
     return 5 * 1000;
   }
-  
+
 }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/f4cf6e6e/server/master/src/main/java/org/apache/accumulo/master/TServerLockWatcher.java
----------------------------------------------------------------------
diff --git a/server/master/src/main/java/org/apache/accumulo/master/TServerLockWatcher.java b/server/master/src/main/java/org/apache/accumulo/master/TServerLockWatcher.java
deleted file mode 100644
index bc701b7..0000000
--- a/server/master/src/main/java/org/apache/accumulo/master/TServerLockWatcher.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * 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.master;
-
-import org.apache.accumulo.fate.zookeeper.ZooLock.AsyncLockWatcher;
-import org.apache.accumulo.fate.zookeeper.ZooLock.LockLossReason;
-
-class TServerLockWatcher implements AsyncLockWatcher {
-  
-  volatile boolean gotLock = false;
-  volatile Exception failureException = null;
-  
-  @Override
-  public void acquiredLock() {
-    gotLock = true;
-  }
-  
-  @Override
-  public void failedToAcquireLock(Exception e) {
-    failureException = e;
-  }
-  
-  @Override
-  public void lostLock(LockLossReason reason) {}
-  
-  @Override
-  public void unableToMonitorLockNode(Throwable e) {}
-  
-}

http://git-wip-us.apache.org/repos/asf/accumulo/blob/f4cf6e6e/server/tserver/src/main/java/org/apache/accumulo/tserver/EndOfTableException.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/EndOfTableException.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/EndOfTableException.java
deleted file mode 100644
index d2956ce..0000000
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/EndOfTableException.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * 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;
-
-public class EndOfTableException extends Exception {
-  
-  /**
-	 * 
-	 */
-  private static final long serialVersionUID = 1L;
-  
-}

http://git-wip-us.apache.org/repos/asf/accumulo/blob/f4cf6e6e/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServerConstants.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServerConstants.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServerConstants.java
deleted file mode 100644
index df416a4..0000000
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServerConstants.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * 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;
-
-public class TabletServerConstants {
-  
-  public static final String IntermediateKeyName = "IntermediateKey";
-  public static final String ColumnSetName = "ColumnSet";
-  public static final String AuthorizationSetName = "AuthorizationSet";
-  public static final String EndKeyName = "EndKey";
-  public static final String MaxResultsName = "MaxResults";
-  public static final String PreviousQueryTypeName = "PreviousQueryType";
-  public static final String PreviousQueryStatusName = "PreviousQueryStatus";
-}

http://git-wip-us.apache.org/repos/asf/accumulo/blob/f4cf6e6e/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 8d49ab6..0194778 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
@@ -41,7 +41,6 @@ import java.util.concurrent.atomic.AtomicLong;
 import java.util.concurrent.atomic.AtomicReference;
 import java.util.concurrent.locks.ReentrantLock;
 
-import com.google.common.annotations.VisibleForTesting;
 import org.apache.accumulo.core.Constants;
 import org.apache.accumulo.core.client.Durability;
 import org.apache.accumulo.core.client.IteratorSetting;
@@ -145,10 +144,12 @@ import org.apache.log4j.Logger;
 import org.apache.zookeeper.KeeperException;
 import org.apache.zookeeper.KeeperException.NoNodeException;
 
+import com.google.common.annotations.VisibleForTesting;
+
 /**
- * 
+ *
  * Provide access to a single row range in a living TabletServer.
- * 
+ *
  */
 public class Tablet implements TabletCommitter {
   static private final Logger log = Logger.getLogger(Tablet.class);
@@ -163,7 +164,7 @@ public class Tablet implements TabletCommitter {
   private final Path location; // absolute path of this tablets dir
 
   private final TabletMemory tabletMemory;
-  
+
   private final TabletTime tabletTime;
   private final Object timeLock = new Object();
   private long persistedTime;
@@ -172,14 +173,15 @@ public class Tablet implements TabletCommitter {
   private volatile boolean tableDirChecked = false;
 
   private final AtomicLong dataSourceDeletions = new AtomicLong(0);
-  public long getDataSourceDeletions() { return dataSourceDeletions.get(); }
+
+  public long getDataSourceDeletions() {
+    return dataSourceDeletions.get();
+  }
+
   private final Set<ScanDataSource> activeScans = new HashSet<ScanDataSource>();
-  
+
   private static enum CloseState {
-    OPEN,
-    CLOSING,
-    CLOSED,
-    COMPLETE
+    OPEN, CLOSING, CLOSED, COMPLETE
   }
 
   private volatile CloseState closeState = CloseState.OPEN;
@@ -188,7 +190,7 @@ public class Tablet implements TabletCommitter {
 
   private long lastFlushID = -1;
   private long lastCompactID = -1;
-  
+
   private static class CompactionWaitInfo {
     long flushID = -1;
     long compactionID = -1;
@@ -196,13 +198,16 @@ public class Tablet implements TabletCommitter {
 
   // stores info about user initiated major compaction that is waiting on a minor compaction to finish
   private CompactionWaitInfo compactionWaitInfo = new CompactionWaitInfo();
-  
-  static enum CompactionState { WAITING_TO_START, IN_PROGRESS };
+
+  static enum CompactionState {
+    WAITING_TO_START, IN_PROGRESS
+  };
+
   private volatile CompactionState minorCompactionState = null;
   private volatile CompactionState majorCompactionState = null;
 
   private final Set<MajorCompactionReason> majorCompactionQueued = Collections.synchronizedSet(EnumSet.noneOf(MajorCompactionReason.class));
-  
+
   private final AtomicReference<ConstraintChecker> constraintChecker = new AtomicReference<ConstraintChecker>();
 
   private int writesInProgress = 0;
@@ -223,7 +228,6 @@ public class Tablet implements TabletCommitter {
 
   private byte[] defaultSecurityLabel = new byte[0];
 
-
   private long lastMinorCompactionFinishTime = 0;
   private long lastMapFileImportTime = 0;
 
@@ -236,11 +240,12 @@ public class Tablet implements TabletCommitter {
   private final ConfigurationObserver configObserver;
 
   private final int logId;
-  
+
+  @Override
   public int getLogId() {
     return logId;
   }
-  
+
   public static class LookupResult {
     public List<Range> unfinishedRanges = new ArrayList<Range>();
     public long bytesAdded = 0;
@@ -262,13 +267,13 @@ public class Tablet implements TabletCommitter {
       } catch (FileNotFoundException ex) {
         // ignored
       }
-      
+
       if (files == null) {
         if (location.getName().startsWith("c-"))
           log.debug("Tablet " + extent + " had no dir, creating " + location); // its a clone dir...
         else
           log.warn("Tablet " + extent + " had no dir, creating " + location);
-      
+
         getTabletServer().getFileSystem().mkdirs(location);
       }
       tableDirChecked = true;
@@ -280,7 +285,8 @@ public class Tablet implements TabletCommitter {
    */
   @VisibleForTesting
   protected Tablet(TabletTime tabletTime, String tabletDirectory, int logId, Path location, DatafileManager datafileManager, TabletServer tabletServer,
-      TabletResourceManager tabletResources, TabletMemory tabletMemory, TableConfiguration tableConfiguration, KeyExtent extent, ConfigurationObserver configObserver) {
+      TabletResourceManager tabletResources, TabletMemory tabletMemory, TableConfiguration tableConfiguration, KeyExtent extent,
+      ConfigurationObserver configObserver) {
     this.tabletTime = tabletTime;
     this.tabletDirectory = tabletDirectory;
     this.logId = logId;
@@ -295,14 +301,14 @@ public class Tablet implements TabletCommitter {
   }
 
   public Tablet(TabletServer tabletServer, KeyExtent extent, TabletResourceManager trm, SplitInfo info) throws IOException {
-    this(tabletServer, new Text(info.getDir()), extent, trm, info.getDatafiles(), info.getTime(), info.getInitFlushID(), info.getInitCompactID(), info.getLastLocation());
+    this(tabletServer, new Text(info.getDir()), extent, trm, info.getDatafiles(), info.getTime(), info.getInitFlushID(), info.getInitCompactID(), info
+        .getLastLocation());
     splitCreationTime = System.currentTimeMillis();
   }
 
-  private Tablet(TabletServer tabletServer, Text location, KeyExtent extent, TabletResourceManager trm,
-      SortedMap<FileRef,DataFileValue> datafiles, String time, long initFlushID, long initCompactID, TServerInstance lastLocation) throws IOException {
-    this(tabletServer, extent, location, trm, NO_LOG_ENTRIES, datafiles, time, lastLocation, new HashSet<FileRef>(), initFlushID,
-        initCompactID);
+  private Tablet(TabletServer tabletServer, Text location, KeyExtent extent, TabletResourceManager trm, SortedMap<FileRef,DataFileValue> datafiles,
+      String time, long initFlushID, long initCompactID, TServerInstance lastLocation) throws IOException {
+    this(tabletServer, extent, location, trm, NO_LOG_ENTRIES, datafiles, time, lastLocation, new HashSet<FileRef>(), initFlushID, initCompactID);
   }
 
   private static String lookupTime(AccumuloConfiguration conf, KeyExtent extent, SortedMap<Key,Value> tabletsKeyValues) {
@@ -442,21 +448,24 @@ public class Tablet implements TabletCommitter {
     }
     return null;
   }
-  
-  public Tablet(TabletServer tabletServer, KeyExtent extent, Text location, TabletResourceManager trm, SortedMap<Key,Value> tabletsKeyValues) throws IOException {
-    this(tabletServer, extent, location, trm, lookupLogEntries(extent, tabletsKeyValues), lookupDatafiles(tabletServer.getConfiguration(), tabletServer.getFileSystem(),
-        extent, tabletsKeyValues), lookupTime(tabletServer.getConfiguration(), extent, tabletsKeyValues), lookupLastServer(extent, tabletsKeyValues),
-        lookupScanFiles(extent, tabletsKeyValues, tabletServer.getFileSystem()), lookupFlushID(extent, tabletsKeyValues), lookupCompactID(extent, tabletsKeyValues));
+
+  public Tablet(TabletServer tabletServer, KeyExtent extent, Text location, TabletResourceManager trm, SortedMap<Key,Value> tabletsKeyValues)
+      throws IOException {
+    this(tabletServer, extent, location, trm, lookupLogEntries(extent, tabletsKeyValues), lookupDatafiles(tabletServer.getConfiguration(),
+        tabletServer.getFileSystem(), extent, tabletsKeyValues), lookupTime(tabletServer.getConfiguration(), extent, tabletsKeyValues), lookupLastServer(
+        extent, tabletsKeyValues), lookupScanFiles(extent, tabletsKeyValues, tabletServer.getFileSystem()), lookupFlushID(extent, tabletsKeyValues),
+        lookupCompactID(extent, tabletsKeyValues));
   }
 
   /**
    * yet another constructor - this one allows us to avoid costly lookups into the Metadata table if we already know the files we need - as at split time
    */
-  private Tablet(final TabletServer tabletServer, final KeyExtent extent, final Text location, final TabletResourceManager trm, final List<LogEntry> rawLogEntries, final SortedMap<FileRef,DataFileValue> rawDatafiles, String time,
-      final TServerInstance lastLocation, Set<FileRef> scanFiles, long initFlushID, long initCompactID) throws IOException {
+  private Tablet(final TabletServer tabletServer, final KeyExtent extent, final Text location, final TabletResourceManager trm,
+      final List<LogEntry> rawLogEntries, final SortedMap<FileRef,DataFileValue> rawDatafiles, String time, final TServerInstance lastLocation,
+      Set<FileRef> scanFiles, long initFlushID, long initCompactID) throws IOException {
 
-    TabletFiles tabletPaths = VolumeUtil.updateTabletVolumes(tabletServer.getLock(), tabletServer.getFileSystem(), extent, new TabletFiles(location.toString(), rawLogEntries,
-        rawDatafiles), ReplicationConfigurationUtil.isEnabled(extent, tabletServer.getTableConfiguration(extent)));
+    TabletFiles tabletPaths = VolumeUtil.updateTabletVolumes(tabletServer.getLock(), tabletServer.getFileSystem(), extent, new TabletFiles(location.toString(),
+        rawLogEntries, rawDatafiles), ReplicationConfigurationUtil.isEnabled(extent, tabletServer.getTableConfiguration(extent)));
 
     Path locationPath;
 
@@ -693,8 +702,8 @@ public class Tablet implements TabletCommitter {
     }
   }
 
-  private LookupResult lookup(SortedKeyValueIterator<Key,Value> mmfi, List<Range> ranges, HashSet<Column> columnSet, List<KVEntry> results,
-      long maxResultsSize) throws IOException {
+  private LookupResult lookup(SortedKeyValueIterator<Key,Value> mmfi, List<Range> ranges, HashSet<Column> columnSet, List<KVEntry> results, long maxResultsSize)
+      throws IOException {
 
     LookupResult lookupResult = new LookupResult();
 
@@ -789,10 +798,6 @@ public class Tablet implements TabletCommitter {
     }
   }
 
-  public static interface KVReceiver {
-    void receive(List<KVEntry> matches) throws IOException;
-  }
-
   public LookupResult lookup(List<Range> ranges, HashSet<Column> columns, Authorizations authorizations, List<KVEntry> results, long maxResultSize,
       List<IterInfo> ssiList, Map<String,Map<String,String>> ssio, AtomicBoolean interruptFlag) throws IOException {
 
@@ -892,7 +897,7 @@ public class Tablet implements TabletCommitter {
 
   /**
    * Determine if a JVM shutdown is in progress.
-   * 
+   *
    */
   boolean shutdownInProgress() {
     try {
@@ -907,8 +912,8 @@ public class Tablet implements TabletCommitter {
     return false;
   }
 
-  public Scanner createScanner(Range range, int num, Set<Column> columns, Authorizations authorizations, List<IterInfo> ssiList, Map<String,Map<String,String>> ssio,
-      boolean isolated, AtomicBoolean interruptFlag) {
+  public Scanner createScanner(Range range, int num, Set<Column> columns, Authorizations authorizations, List<IterInfo> ssiList,
+      Map<String,Map<String,String>> ssio, boolean isolated, AtomicBoolean interruptFlag) {
     // do a test to see if this range falls within the tablet, if it does not
     // then clip will throw an exception
     extent.toDataRange().clip(range);
@@ -916,8 +921,9 @@ public class Tablet implements TabletCommitter {
     ScanOptions opts = new ScanOptions(num, authorizations, this.defaultSecurityLabel, columns, ssiList, ssio, interruptFlag, isolated);
     return new Scanner(this, range, opts);
   }
-  DataFileValue minorCompact(VolumeManager fs, InMemoryMap memTable, FileRef tmpDatafile, FileRef newDatafile, FileRef mergeFile,
-      boolean hasQueueTime, long queued, CommitSession commitSession, long flushId, MinorCompactionReason mincReason) {
+
+  DataFileValue minorCompact(VolumeManager fs, InMemoryMap memTable, FileRef tmpDatafile, FileRef newDatafile, FileRef mergeFile, boolean hasQueueTime,
+      long queued, CommitSession commitSession, long flushId, MinorCompactionReason mincReason) {
     boolean failed = false;
     long start = System.currentTimeMillis();
     timer.incrementStatusMinor();
@@ -1085,8 +1091,8 @@ public class Tablet implements TabletCommitter {
       synchronized (this) {
         t1 = System.currentTimeMillis();
 
-        if (isClosing() || isClosed() || majorCompactionState == CompactionState.WAITING_TO_START || getTabletMemory().memoryReservedForMinC() || getTabletMemory().getMemTable().getNumEntries() == 0
-            || updatingFlushID) {
+        if (isClosing() || isClosed() || majorCompactionState == CompactionState.WAITING_TO_START || getTabletMemory().memoryReservedForMinC()
+            || getTabletMemory().getMemTable().getNumEntries() == 0 || updatingFlushID) {
 
           logMessage = new StringBuilder();
 
@@ -1266,6 +1272,7 @@ public class Tablet implements TabletCommitter {
     return finishPreparingMutations(time);
   }
 
+  @Override
   public synchronized void abortCommit(CommitSession commitSession, List<Mutation> value) {
     if (writesInProgress <= 0) {
       throw new IllegalStateException("waitingForLogs <= 0 " + writesInProgress);
@@ -1281,6 +1288,7 @@ public class Tablet implements TabletCommitter {
       this.notifyAll();
   }
 
+  @Override
   public void commit(CommitSession commitSession, List<Mutation> mutations) {
 
     int totalCount = 0;
@@ -1532,7 +1540,7 @@ public class Tablet implements TabletCommitter {
 
   /**
    * Returns a Path object representing the tablet's location on the DFS.
-   * 
+   *
    * @return location
    */
   public Path getLocation() {
@@ -1554,7 +1562,7 @@ public class Tablet implements TabletCommitter {
 
   /**
    * Returns true if a major compaction should be performed on the tablet.
-   * 
+   *
    */
   public boolean needsMajorCompaction(MajorCompactionReason reason) {
     if (isMajorCompactionRunning())
@@ -1566,7 +1574,7 @@ public class Tablet implements TabletCommitter {
 
   /**
    * Returns an int representing the total block size of the files served by this tablet.
-   * 
+   *
    * @return size
    */
   // this is the size of just the files
@@ -1753,7 +1761,7 @@ public class Tablet implements TabletCommitter {
 
   /**
    * Returns true if this tablet needs to be split
-   * 
+   *
    */
   public synchronized boolean needsSplit() {
     if (isClosing() || isClosed())
@@ -1773,8 +1781,7 @@ public class Tablet implements TabletCommitter {
 
     // acquire file info outside of tablet lock
     CompactionStrategy strategy = Property.createTableInstanceFromPropertyName(tableConfiguration, Property.TABLE_COMPACTION_STRATEGY,
-        CompactionStrategy.class,
-        new DefaultCompactionStrategy());
+        CompactionStrategy.class, new DefaultCompactionStrategy());
     strategy.init(Property.getCompactionStrategyOptions(tableConfiguration));
 
     Map<FileRef,Pair<Key,Key>> firstAndLastKeys = null;
@@ -1927,8 +1934,8 @@ public class Tablet implements TabletCommitter {
 
           // always propagate deletes, unless last batch
           boolean lastBatch = filesToCompact.isEmpty();
-          Compactor compactor = new Compactor(this, copy, null, compactTmpName, lastBatch ? propogateDeletes : true, cenv,
-              compactionIterators, reason.ordinal(), tableConf);
+          Compactor compactor = new Compactor(this, copy, null, compactTmpName, lastBatch ? propogateDeletes : true, cenv, compactionIterators,
+              reason.ordinal(), tableConf);
 
           CompactionStats mcs = compactor.call();
 
@@ -2031,7 +2038,7 @@ public class Tablet implements TabletCommitter {
         // check that compaction is still needed - defer to splitting
         majorCompactionQueued.remove(reason);
 
-        if (isClosing() || isClosed ()|| !needsMajorCompaction(reason) || isMajorCompactionRunning() || needsSplit()) {
+        if (isClosing() || isClosed() || !needsMajorCompaction(reason) || isMajorCompactionRunning() || needsSplit()) {
           return null;
         }
 
@@ -2078,9 +2085,10 @@ public class Tablet implements TabletCommitter {
 
   /**
    * Returns a KeyExtent object representing this tablet's key range.
-   * 
+   *
    * @return extent
    */
+  @Override
   public KeyExtent getExtent() {
     return extent;
   }
@@ -2129,7 +2137,7 @@ public class Tablet implements TabletCommitter {
   }
 
   public boolean isMinorCompactionRunning() {
-    return minorCompactionState == CompactionState.IN_PROGRESS; 
+    return minorCompactionState == CompactionState.IN_PROGRESS;
   }
 
   public boolean isMajorCompactionQueued() {
@@ -2137,11 +2145,11 @@ public class Tablet implements TabletCommitter {
   }
 
   public TreeMap<KeyExtent,SplitInfo> split(byte[] sp) throws IOException {
-	  
+
     if (sp != null && extent.getEndRow() != null && extent.getEndRow().equals(new Text(sp))) {
       throw new IllegalArgumentException();
     }
-    
+
     if (sp != null && sp.length > tableConfiguration.getMemoryInBytes(Property.TABLE_MAX_END_ROW_SIZE)) {
       String msg = "Cannot split tablet " + extent + ", selected split point too long.  Length :  " + sp.length;
       log.warn(msg);
@@ -2166,7 +2174,8 @@ public class Tablet implements TabletCommitter {
     // this info is used for optimization... it is ok if map files are missing
     // from the set... can still query and insert into the tablet while this
     // map file operation is happening
-    Map<FileRef,FileUtil.FileInfo> firstAndLastRows = FileUtil.tryToGetFirstAndLastRows(getTabletServer().getFileSystem(), getTabletServer().getConfiguration(), getDatafileManager().getFiles());
+    Map<FileRef,FileUtil.FileInfo> firstAndLastRows = FileUtil.tryToGetFirstAndLastRows(getTabletServer().getFileSystem(),
+        getTabletServer().getConfiguration(), getDatafileManager().getFiles());
 
     synchronized (this) {
       // java needs tuples ...
@@ -2179,8 +2188,8 @@ public class Tablet implements TabletCommitter {
         splitPoint = findSplitRow(getDatafileManager().getFiles());
       else {
         Text tsp = new Text(sp);
-        splitPoint = new SplitRowSpec(FileUtil.estimatePercentageLTE(getTabletServer().getFileSystem(), getTabletServer().getConfiguration(), extent.getPrevEndRow(), extent.getEndRow(),
-            FileUtil.toPathStrings(getDatafileManager().getFiles()), tsp), tsp);
+        splitPoint = new SplitRowSpec(FileUtil.estimatePercentageLTE(getTabletServer().getFileSystem(), getTabletServer().getConfiguration(),
+            extent.getPrevEndRow(), extent.getEndRow(), FileUtil.toPathStrings(getDatafileManager().getFiles()), tsp), tsp);
       }
 
       if (splitPoint == null || splitPoint.row == null) {
@@ -2188,7 +2197,7 @@ public class Tablet implements TabletCommitter {
         closeState = CloseState.OPEN;
         return null;
       }
-      
+
       closeState = CloseState.CLOSING;
       completeClose(true, false);
 
@@ -2219,8 +2228,8 @@ public class Tablet implements TabletCommitter {
       Map<FileRef,Long> bulkLoadedFiles = MetadataTableUtil.getBulkFilesLoaded(SystemCredentials.get(), extent);
 
       MetadataTableUtil.splitTablet(high, extent.getPrevEndRow(), splitRatio, SystemCredentials.get(), getTabletServer().getLock());
-      MasterMetadataUtil.addNewTablet(low, lowDirectory, getTabletServer().getTabletSession(), lowDatafileSizes, bulkLoadedFiles, SystemCredentials.get(), time,
-          lastFlushID, lastCompactID, getTabletServer().getLock());
+      MasterMetadataUtil.addNewTablet(low, lowDirectory, getTabletServer().getTabletSession(), lowDatafileSizes, bulkLoadedFiles, SystemCredentials.get(),
+          time, lastFlushID, lastCompactID, getTabletServer().getLock());
       MetadataTableUtil.finishSplit(high, highDatafileSizes, highDatafilesToRemove, SystemCredentials.get(), getTabletServer().getLock());
 
       log.log(TLevel.TABLET_HIST, extent + " split " + low + " " + high);
@@ -2400,6 +2409,7 @@ public class Tablet implements TabletCommitter {
     return currentLogs.size();
   }
 
+  @Override
   public boolean beginUpdatingLogsUsed(InMemoryMap memTable, Collection<DfsLogger> more, boolean mincFinish) {
 
     boolean releaseLock = true;
@@ -2476,6 +2486,7 @@ public class Tablet implements TabletCommitter {
     }
   }
 
+  @Override
   public void finishUpdatingLogsUsed() {
     logLock.unlock();
   }
@@ -2529,6 +2540,7 @@ public class Tablet implements TabletCommitter {
     }
   }
 
+  @Override
   public TableConfiguration getTableConfiguration() {
     return tableConfiguration;
   }
@@ -2542,7 +2554,7 @@ public class Tablet implements TabletCommitter {
   public void updateMemoryUsageStats(long size, long mincSize) {
     getTabletResources().updateMemoryUsageStats(this, size, mincSize);
   }
-  
+
   public long incrementDataSourceDeletions() {
     return dataSourceDeletions.incrementAndGet();
   }
@@ -2561,12 +2573,14 @@ public class Tablet implements TabletCommitter {
       if (bulkTime > persistedTime)
         persistedTime = bulkTime;
 
-      MetadataTableUtil.updateTabletDataFile(tid, extent, paths, tabletTime.getMetadataValue(persistedTime), SystemCredentials.get(), getTabletServer().getLock());
+      MetadataTableUtil.updateTabletDataFile(tid, extent, paths, tabletTime.getMetadataValue(persistedTime), SystemCredentials.get(), getTabletServer()
+          .getLock());
     }
 
   }
 
-  public void updateTabletDataFile(long maxCommittedTime, FileRef newDatafile, FileRef absMergeFile, DataFileValue dfv, Set<String> unusedWalLogs, Set<FileRef> filesInUseByScans, long flushId) {
+  public void updateTabletDataFile(long maxCommittedTime, FileRef newDatafile, FileRef absMergeFile, DataFileValue dfv, Set<String> unusedWalLogs,
+      Set<FileRef> filesInUseByScans, long flushId) {
     synchronized (timeLock) {
       if (maxCommittedTime > persistedTime)
         persistedTime = maxCommittedTime;
@@ -2576,7 +2590,6 @@ public class Tablet implements TabletCommitter {
           tabletServer.getClientAddressString(), tabletServer.getLock(), unusedWalLogs, lastLocation, flushId);
     }
 
-    
   }
 
   TabletResourceManager getTabletResources() {
@@ -2610,7 +2623,7 @@ public class Tablet implements TabletCommitter {
   }
 
   synchronized public void addActiveScans(ScanDataSource scanDataSource) {
-    activeScans.add(scanDataSource);   
+    activeScans.add(scanDataSource);
   }
 
   public int removeScan(ScanDataSource scanDataSource) {
@@ -2625,7 +2638,7 @@ public class Tablet implements TabletCommitter {
 
   public void removeMajorCompactionQueuedReason(MajorCompactionReason reason) {
     majorCompactionQueued.remove(reason);
-    
+
   }
 
   public void minorCompactionWaitingToStart() {


Mime
View raw message