diff --git a/src/java/org/apache/cassandra/db/ReadCommand.java b/src/java/org/apache/cassandra/db/ReadCommand.java index eb3cf15a6b..35a6c5a02e 100644 --- a/src/java/org/apache/cassandra/db/ReadCommand.java +++ b/src/java/org/apache/cassandra/db/ReadCommand.java @@ -92,7 +92,6 @@ class ReadCommandSerializer implements ICompactSerializer private static final Map CMD_SERIALIZER_MAP = new HashMap(); static { - CMD_SERIALIZER_MAP.put(ReadCommand.CMD_TYPE_GET_ROW, new RowReadCommandSerializer()); CMD_SERIALIZER_MAP.put(ReadCommand.CMD_TYPE_GET_COLUMN, new ColumnReadCommandSerializer()); CMD_SERIALIZER_MAP.put(ReadCommand.CMD_TYPE_GET_SLICE_BY_NAMES, new SliceByNamesReadCommandSerializer()); CMD_SERIALIZER_MAP.put(ReadCommand.CMD_TYPE_GET_COLUMNS_SINCE, new ColumnsSinceReadCommandSerializer()); diff --git a/src/java/org/apache/cassandra/db/RowReadCommand.java b/src/java/org/apache/cassandra/db/RowReadCommand.java deleted file mode 100644 index 2b06a67b40..0000000000 --- a/src/java/org/apache/cassandra/db/RowReadCommand.java +++ /dev/null @@ -1,84 +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; - -import java.io.DataInputStream; -import java.io.DataOutputStream; -import java.io.IOException; - -public class RowReadCommand extends ReadCommand -{ - public RowReadCommand(String table, String key) - { - super(table, key, CMD_TYPE_GET_ROW); - } - - @Override - public String getColumnFamilyName() - { - return null; - } - - @Override - public ReadCommand copy() - { - ReadCommand readCommand= new RowReadCommand(table, key); - readCommand.setDigestQuery(isDigestQuery()); - return readCommand; - } - - @Override - public Row getRow(Table table) throws IOException - { - return table.get(key); - } - - @Override - public String toString() - { - return "RowReadCommand(" + - "table='" + table + '\'' + - ", key='" + key + '\'' + - ')'; - } - -} - -class RowReadCommandSerializer extends ReadCommandSerializer -{ - @Override - public void serialize(ReadCommand rm, DataOutputStream dos) throws IOException - { - RowReadCommand realRM = (RowReadCommand)rm; - dos.writeBoolean(realRM.isDigestQuery()); - dos.writeUTF(realRM.table); - dos.writeUTF(realRM.key); - } - - @Override - public ReadCommand deserialize(DataInputStream dis) throws IOException - { - boolean isDigest = dis.readBoolean(); - String table = dis.readUTF(); - String key = dis.readUTF(); - RowReadCommand rm = new RowReadCommand(table, key); - rm.setDigestQuery(isDigest); - return rm; - } -} diff --git a/test/unit/org/apache/cassandra/db/ReadMessageTest.java b/test/unit/org/apache/cassandra/db/ReadMessageTest.java index aa7740fdf4..3803352838 100644 --- a/test/unit/org/apache/cassandra/db/ReadMessageTest.java +++ b/test/unit/org/apache/cassandra/db/ReadMessageTest.java @@ -49,10 +49,6 @@ public class ReadMessageTest rm2 = serializeAndDeserializeReadMessage(rm); assert rm2.toString().equals(rm.toString()); - rm = new RowReadCommand("Table1", "row1"); - rm2 = serializeAndDeserializeReadMessage(rm); - assert rm2.toString().equals(rm.toString()); - rm = new ColumnsSinceReadCommand("Table1", "row1", "foo", 1); rm2 = serializeAndDeserializeReadMessage(rm); assert rm2.toString().equals(rm.toString());