diff --git a/CHANGES.txt b/CHANGES.txt index 06c5636a89..507507c6dd 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -21,6 +21,7 @@ * Allow c* to be shutdown in an embedded mode (CASSANDRA-5635) * Add server side batching to native transport (CASSANDRA-5663) * Make batchlog replay asynchronous (CASSANDRA-6134) + * remove unused classes (CASSANDRA-7197) Merged from 2.0: * (Hadoop) support authentication in CqlRecordReader (CASSANDRA-7221) * (Hadoop) Close java driver Cluster in CQLRR.close (CASSANDRA-7228) 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 afd268dd8b..0000000000 --- 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 implements OnDiskAtomIterator -{ - public void close() throws IOException {} -} 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 df484e7102..0000000000 --- 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); -} 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 7e1c955dae..0000000000 --- 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); -} diff --git a/src/java/org/apache/cassandra/service/PendingRangeCalculatorService.java b/src/java/org/apache/cassandra/service/PendingRangeCalculatorService.java index 5cbb54f181..74624d2ee2 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(); 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 c9b04f0dec..0000000000 --- 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 -{ -} 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 0d0136246d..0000000000 --- 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 -} 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 c79733183b..0000000000 --- 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() - { - @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)); - } - -} 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 236e177e49..0000000000 --- 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; - } -} 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 02a07e9a21..0000000000 --- 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); - } -} 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 2845bc31ba..0000000000 --- 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