From 49b526169abc81726034eab77f03010cbcdfb95f Mon Sep 17 00:00:00 2001 From: Sean Busbey Date: Thu, 28 Aug 2014 09:53:23 -0500 Subject: [PATCH] HBASE-11849 remove classes with audience.private for internals that we don't use. Signed-off-by: Jonathan M Hsieh --- .../encode/ThreadLocalEncoderPool.java | 64 ------------------- .../wal/OrphanHLogAfterSplitException.java | 44 ------------- 2 files changed, 108 deletions(-) delete mode 100644 hbase-prefix-tree/src/main/java/org/apache/hadoop/hbase/codec/prefixtree/encode/ThreadLocalEncoderPool.java delete mode 100644 hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/OrphanHLogAfterSplitException.java diff --git a/hbase-prefix-tree/src/main/java/org/apache/hadoop/hbase/codec/prefixtree/encode/ThreadLocalEncoderPool.java b/hbase-prefix-tree/src/main/java/org/apache/hadoop/hbase/codec/prefixtree/encode/ThreadLocalEncoderPool.java deleted file mode 100644 index 6cbe0c28bba..00000000000 --- a/hbase-prefix-tree/src/main/java/org/apache/hadoop/hbase/codec/prefixtree/encode/ThreadLocalEncoderPool.java +++ /dev/null @@ -1,64 +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.hadoop.hbase.codec.prefixtree.encode; - -import java.io.OutputStream; - -import org.apache.hadoop.classification.InterfaceAudience; - - -/** - * Pool to enable reusing the Encoder objects which can consist of thousands of smaller objects and - * would be more garbage than the data in the block. A new encoder is needed for each block in - * a flush, compaction, RPC response, etc. - * - * It is not a pool in the traditional sense, but implements the semantics of a traditional pool - * via ThreadLocals to avoid sharing between threads. Sharing between threads would not be - * very expensive given that it's accessed per-block, but this is just as easy. - * - * This pool implementation assumes there is a one-to-one mapping between a single thread and a - * single flush or compaction. - */ -@InterfaceAudience.Private -public class ThreadLocalEncoderPool implements EncoderPool{ - - private static final ThreadLocal ENCODER - = new ThreadLocal(); - - /** - * Get the encoder attached to the current ThreadLocal, or create a new one and attach it to the - * current thread. - */ - @Override - public PrefixTreeEncoder checkOut(OutputStream os, boolean includeMvccVersion) { - PrefixTreeEncoder builder = ENCODER.get(); - builder = EncoderFactory.prepareEncoder(builder, os, includeMvccVersion); - ENCODER.set(builder); - return builder; - } - - @Override - public void checkIn(PrefixTreeEncoder encoder) { - // attached to thread on checkOut, so shouldn't need to do anything here - - // do we need to worry about detaching encoders from compaction threads or are the same threads - // used over and over - } - -} \ No newline at end of file diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/OrphanHLogAfterSplitException.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/OrphanHLogAfterSplitException.java deleted file mode 100644 index 4fc19f306eb..00000000000 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/OrphanHLogAfterSplitException.java +++ /dev/null @@ -1,44 +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.hadoop.hbase.regionserver.wal; - -import org.apache.hadoop.classification.InterfaceAudience; - -import java.io.IOException; - -@InterfaceAudience.Private -public class OrphanHLogAfterSplitException extends IOException { - - private static final long serialVersionUID = -4363805979687710634L; - - /** - * Create this exception without a message - */ - public OrphanHLogAfterSplitException() { - super(); - } - - /** - * Create this exception with a message - * @param message why it failed - */ - public OrphanHLogAfterSplitException(String message) { - super(message); - } -}