Repository: cassandra Updated Branches: refs/heads/trunk 072283739 -> 15e0814c5
remove unused classes patch by dshelepov reviewed by dbrosius for cassandra-7197 Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/c5496131 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/c5496131 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/c5496131 Branch: refs/heads/trunk Commit: c54961316533d552f0edc9326fa805874a35c587 Parents: 6be62c2 Author: Daniel Shelepov <[email protected]> Authored: Wed May 14 20:39:06 2014 -0400 Committer: Dave Brosius <[email protected]> Committed: Wed May 14 20:39:06 2014 -0400 ---------------------------------------------------------------------- CHANGES.txt | 3 + .../SimpleAbstractColumnIterator.java | 29 ------- .../apache/cassandra/db/context/IContext.java | 75 ---------------- .../cassandra/gms/IFailureNotification.java | 27 ------ .../service/PendingRangeCalculatorService.java | 2 +- .../PendingRangeCalculatorServiceMBean.java | 23 ----- .../apache/cassandra/thrift/RequestType.java | 24 ------ .../cassandra/utils/AtomicLongArrayUpdater.java | 91 -------------------- .../apache/cassandra/utils/DefaultDouble.java | 46 ---------- .../apache/cassandra/utils/LatencyTracker.java | 82 ------------------ .../cassandra/utils/SkipNullRepresenter.java | 40 --------- 11 files changed, 4 insertions(+), 438 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cassandra/blob/c5496131/CHANGES.txt ---------------------------------------------------------------------- diff --git a/CHANGES.txt b/CHANGES.txt index 450e337..7bab4cc 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,3 +1,6 @@ +3.0 + * remove unused classes (CASSANDRA-7197) + 2.1.0-rc1 * Add PowerShell Windows launch scripts (CASSANDRA-7001) * Make commitlog archive+restore more robust (CASSANDRA-6974) http://git-wip-us.apache.org/repos/asf/cassandra/blob/c5496131/src/java/org/apache/cassandra/db/columniterator/SimpleAbstractColumnIterator.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/cassandra/db/columniterator/SimpleAbstractColumnIterator.java b/src/java/org/apache/cassandra/db/columniterator/SimpleAbstractColumnIterator.java deleted file mode 100644 index afd268d..0000000 --- a/src/java/org/apache/cassandra/db/columniterator/SimpleAbstractColumnIterator.java +++ /dev/null @@ -1,29 +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.cassandra.db.columniterator; - -import java.io.IOException; - -import com.google.common.collect.AbstractIterator; - -import org.apache.cassandra.db.OnDiskAtom; - -public abstract class SimpleAbstractColumnIterator extends AbstractIterator<OnDiskAtom> implements OnDiskAtomIterator -{ - public void close() throws IOException {} -} http://git-wip-us.apache.org/repos/asf/cassandra/blob/c5496131/src/java/org/apache/cassandra/db/context/IContext.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/cassandra/db/context/IContext.java b/src/java/org/apache/cassandra/db/context/IContext.java deleted file mode 100644 index df484e7..0000000 --- a/src/java/org/apache/cassandra/db/context/IContext.java +++ /dev/null @@ -1,75 +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.cassandra.db.context; - -import java.nio.ByteBuffer; - -import org.apache.cassandra.utils.memory.AbstractAllocator; - -/** - * An opaque commutative context. - * - * Maintains a ByteBuffer context that represents a partitioned commutative value. - */ -public interface IContext -{ - public static enum ContextRelationship - { - EQUAL, - GREATER_THAN, - LESS_THAN, - DISJOINT - }; - - /** - * Determine the relationship between two contexts. - * - * EQUAL: Equal set of nodes and every count is equal. - * GREATER_THAN: Superset of nodes and every count is equal or greater than its corollary. - * LESS_THAN: Subset of nodes and every count is equal or less than its corollary. - * DISJOINT: Node sets are not equal and/or counts are not all greater or less than. - * - * @param left - * context. - * @param right - * context. - * @return the ContextRelationship between the contexts. - */ - public ContextRelationship diff(ByteBuffer left, ByteBuffer right); - - /** - * Return a context w/ an aggregated count for each node id. - * - * @param left - * context. - * @param right - * context. - * @param allocator - * an allocator to allocate the new context from. - */ - public ByteBuffer merge(ByteBuffer left, ByteBuffer right, AbstractAllocator allocator); - - /** - * Human-readable String from context. - * - * @param context - * context. - * @return a human-readable String of the context. - */ - public String toString(ByteBuffer context); -} http://git-wip-us.apache.org/repos/asf/cassandra/blob/c5496131/src/java/org/apache/cassandra/gms/IFailureNotification.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/cassandra/gms/IFailureNotification.java b/src/java/org/apache/cassandra/gms/IFailureNotification.java deleted file mode 100644 index 7e1c955..0000000 --- a/src/java/org/apache/cassandra/gms/IFailureNotification.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.cassandra.gms; - -import java.net.InetAddress; - -public interface IFailureNotification -{ - public void convict(InetAddress ep); - - public void revive(InetAddress ep); -} http://git-wip-us.apache.org/repos/asf/cassandra/blob/c5496131/src/java/org/apache/cassandra/service/PendingRangeCalculatorService.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/cassandra/service/PendingRangeCalculatorService.java b/src/java/org/apache/cassandra/service/PendingRangeCalculatorService.java index 59a8843..abf8df2 100644 --- a/src/java/org/apache/cassandra/service/PendingRangeCalculatorService.java +++ b/src/java/org/apache/cassandra/service/PendingRangeCalculatorService.java @@ -43,7 +43,7 @@ import java.util.Set; import java.util.Collection; import java.util.concurrent.*; -public class PendingRangeCalculatorService extends PendingRangeCalculatorServiceMBean +public class PendingRangeCalculatorService { public static final PendingRangeCalculatorService instance = new PendingRangeCalculatorService(); http://git-wip-us.apache.org/repos/asf/cassandra/blob/c5496131/src/java/org/apache/cassandra/service/PendingRangeCalculatorServiceMBean.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/cassandra/service/PendingRangeCalculatorServiceMBean.java b/src/java/org/apache/cassandra/service/PendingRangeCalculatorServiceMBean.java deleted file mode 100644 index c9b04f0..0000000 --- a/src/java/org/apache/cassandra/service/PendingRangeCalculatorServiceMBean.java +++ /dev/null @@ -1,23 +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.cassandra.service; - -public class PendingRangeCalculatorServiceMBean -{ -} http://git-wip-us.apache.org/repos/asf/cassandra/blob/c5496131/src/java/org/apache/cassandra/thrift/RequestType.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/cassandra/thrift/RequestType.java b/src/java/org/apache/cassandra/thrift/RequestType.java deleted file mode 100644 index 0d01362..0000000 --- a/src/java/org/apache/cassandra/thrift/RequestType.java +++ /dev/null @@ -1,24 +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.cassandra.thrift; - -public enum RequestType -{ - READ, - WRITE -} http://git-wip-us.apache.org/repos/asf/cassandra/blob/c5496131/src/java/org/apache/cassandra/utils/AtomicLongArrayUpdater.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/cassandra/utils/AtomicLongArrayUpdater.java b/src/java/org/apache/cassandra/utils/AtomicLongArrayUpdater.java deleted file mode 100644 index c797331..0000000 --- a/src/java/org/apache/cassandra/utils/AtomicLongArrayUpdater.java +++ /dev/null @@ -1,91 +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.cassandra.utils; - -import sun.misc.Unsafe; - -import java.lang.reflect.Field; -import java.security.AccessController; -import java.security.PrivilegedAction; - -public final class AtomicLongArrayUpdater { - - private static final long offset; - private static final int shift; - - static final Unsafe theUnsafe; - - static { - theUnsafe = (Unsafe) AccessController.doPrivileged( - new PrivilegedAction<Object>() - { - @Override - public Object run() - { - try - { - Field f = Unsafe.class.getDeclaredField("theUnsafe"); - f.setAccessible(true); - return f.get(null); - } catch (NoSuchFieldException e) - { - // It doesn't matter what we throw; - // it's swallowed in getBest(). - throw new Error(); - } catch (IllegalAccessException e) - { - throw new Error(); - } - } - }); - Class<?> clazz = long[].class; - offset = theUnsafe.arrayBaseOffset(clazz); - shift = shift(theUnsafe.arrayIndexScale(clazz)); - } - - private static int shift(int scale) - { - if (Integer.bitCount(scale) != 1) - throw new IllegalStateException(); - return Integer.bitCount(scale - 1); - } - - public AtomicLongArrayUpdater() { } - - public final boolean compareAndSet(Object trg, int i, long exp, long upd) { - return theUnsafe.compareAndSwapLong(trg, offset + (i << shift), exp, upd); - } - - public final void putVolatile(Object trg, int i, long val) { - theUnsafe.putLongVolatile(trg, offset + (i << shift), val); - } - - public final void putOrdered(Object trg, int i, long val) { - theUnsafe.putOrderedLong(trg, offset + (i << shift), val); - } - - public final long get(Object trg, int i) { - return theUnsafe.getLong(trg, offset + (i << shift)); - } - - public final long getVolatile(Object trg, int i) { - return theUnsafe.getLongVolatile(trg, offset + (i << shift)); - } - -} http://git-wip-us.apache.org/repos/asf/cassandra/blob/c5496131/src/java/org/apache/cassandra/utils/DefaultDouble.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/cassandra/utils/DefaultDouble.java b/src/java/org/apache/cassandra/utils/DefaultDouble.java deleted file mode 100644 index 236e177..0000000 --- a/src/java/org/apache/cassandra/utils/DefaultDouble.java +++ /dev/null @@ -1,46 +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.cassandra.utils; - - -public class DefaultDouble -{ - private final double originalValue; - private double currentValue; - - public DefaultDouble(double value) - { - originalValue = value; - currentValue = value; - } - - public double value() - { - return currentValue; - } - - public void set(double d) - { - currentValue = d; - } - - public boolean isModified() - { - return originalValue != currentValue; - } -} http://git-wip-us.apache.org/repos/asf/cassandra/blob/c5496131/src/java/org/apache/cassandra/utils/LatencyTracker.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/cassandra/utils/LatencyTracker.java b/src/java/org/apache/cassandra/utils/LatencyTracker.java deleted file mode 100644 index 02a07e9..0000000 --- a/src/java/org/apache/cassandra/utils/LatencyTracker.java +++ /dev/null @@ -1,82 +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.cassandra.utils; - -import java.util.concurrent.atomic.AtomicLong; - -public class LatencyTracker -{ - private final AtomicLong opCount = new AtomicLong(0); - private final AtomicLong totalLatency = new AtomicLong(0); - private long lastLatency = 0; - private long lastOpCount = 0; - private final EstimatedHistogram totalHistogram = new EstimatedHistogram(); - private final EstimatedHistogram recentHistogram = new EstimatedHistogram(); - - /** takes nanoseconds **/ - public void addNano(long nanos) - { - // convert to microseconds. 1 millionth - addMicro(nanos / 1000); - } - - public void addMicro(long micros) - { - opCount.incrementAndGet(); - totalLatency.addAndGet(micros); - totalHistogram.add(micros); - recentHistogram.add(micros); - } - - public long getOpCount() - { - return opCount.get(); - } - - /** returns microseconds */ - public long getTotalLatencyMicros() - { - return totalLatency.get(); - } - - /** returns microseconds */ - public double getRecentLatencyMicros() - { - long ops = opCount.get(); - long n = totalLatency.get(); - try - { - return ((double)n - lastLatency) / (ops - lastOpCount); - } - finally - { - lastLatency = n; - lastOpCount = ops; - } - } - - public long[] getTotalLatencyHistogramMicros() - { - return totalHistogram.getBuckets(false); - } - - public long[] getRecentLatencyHistogramMicros() - { - return recentHistogram.getBuckets(true); - } -} http://git-wip-us.apache.org/repos/asf/cassandra/blob/c5496131/src/java/org/apache/cassandra/utils/SkipNullRepresenter.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/cassandra/utils/SkipNullRepresenter.java b/src/java/org/apache/cassandra/utils/SkipNullRepresenter.java deleted file mode 100644 index 2845bc3..0000000 --- a/src/java/org/apache/cassandra/utils/SkipNullRepresenter.java +++ /dev/null @@ -1,40 +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.cassandra.utils; - -import org.yaml.snakeyaml.introspector.Property; -import org.yaml.snakeyaml.nodes.NodeTuple; -import org.yaml.snakeyaml.nodes.Tag; -import org.yaml.snakeyaml.representer.Representer; - - -/* used to prevent null values from being included in generated YAML */ -public class SkipNullRepresenter extends Representer -{ - protected NodeTuple representJavaBeanProperty(Object javaBean, Property property, Object propertyValue, Tag customTag) - { - if (propertyValue == null) - { - return null; - } - else - { - return super.representJavaBeanProperty(javaBean, property, propertyValue, customTag); - } - } -} \ No newline at end of file
