Skip to content

Commit

Permalink
refactor thrift-specific code ...server -> ...thrift
Browse files Browse the repository at this point in the history
This was mostly an IDE-driven effort.

Patch by eevans

git-svn-id: https://svn.apache.org/repos/asf/incubator/cassandra/trunk@904540 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
Eric Evans committed Jan 29, 2010
1 parent 3bf9c81 commit 542bd79
Show file tree
Hide file tree
Showing 47 changed files with 98 additions and 60 deletions.
4 changes: 2 additions & 2 deletions bin/cassandra
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,11 @@ launch_service()
if [ "x$foreground" != "x" ]; then
cassandra_parms="$cassandra_parms -Dcassandra-foreground=yes"
$JAVA $JVM_OPTS $cassandra_parms -cp $CLASSPATH $props \
org.apache.cassandra.service.CassandraDaemon
org.apache.cassandra.thrift.CassandraDaemon
# Startup CassandraDaemon, background it, and write the pid.
else
exec $JAVA $JVM_OPTS $cassandra_parms -cp $CLASSPATH $props \
org.apache.cassandra.service.CassandraDaemon <&- &
org.apache.cassandra.thrift.CassandraDaemon <&- &
[ ! -z $pidpath ] && printf "%d" $! > $pidpath
fi

Expand Down
6 changes: 5 additions & 1 deletion contrib/client_only/ClientOnlyExample.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@
import org.apache.cassandra.db.filter.QueryPath;
import org.apache.cassandra.db.marshal.AbstractType;
import org.apache.cassandra.service.*;
import static org.apache.cassandra.service.ThriftGlue.createColumnPath;
import org.apache.cassandra.thrift.ColumnPath;
import org.apache.cassandra.thrift.ConsistencyLevel;
import org.apache.cassandra.thrift.UnavailableException;

import static org.apache.cassandra.thrift.ThriftGlue.createColumnPath;

import java.io.IOException;
import java.util.ArrayList;
Expand Down
2 changes: 1 addition & 1 deletion interface/cassandra.thrift
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
# Interface definition for Cassandra Service
#

namespace java org.apache.cassandra.service
namespace java org.apache.cassandra.thrift
namespace cpp org.apache.cassandra
namespace csharp Apache.Cassandra
namespace py cassandra
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
*/
package org.apache.cassandra.service;
package org.apache.cassandra.thrift;

import java.util.List;
import java.util.ArrayList;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
*/
package org.apache.cassandra.service;
package org.apache.cassandra.thrift;

import java.util.List;
import java.util.ArrayList;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
*/
package org.apache.cassandra.service;
package org.apache.cassandra.thrift;

import java.util.List;
import java.util.ArrayList;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
*/
package org.apache.cassandra.service;
package org.apache.cassandra.thrift;

import java.util.List;
import java.util.ArrayList;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
*/
package org.apache.cassandra.service;
package org.apache.cassandra.thrift;

import java.util.List;
import java.util.ArrayList;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
*/
package org.apache.cassandra.service;
package org.apache.cassandra.thrift;

import java.util.List;
import java.util.ArrayList;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
*/
package org.apache.cassandra.service;
package org.apache.cassandra.thrift;

import java.util.List;
import java.util.ArrayList;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
*/
package org.apache.cassandra.service;
package org.apache.cassandra.thrift;

import java.util.List;
import java.util.ArrayList;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
*/
package org.apache.cassandra.service;
package org.apache.cassandra.thrift;


import java.util.Map;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
*/
package org.apache.cassandra.service;
package org.apache.cassandra.thrift;

import java.util.List;
import java.util.ArrayList;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
*/
package org.apache.cassandra.service;
package org.apache.cassandra.thrift;

import java.util.List;
import java.util.ArrayList;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
*/
package org.apache.cassandra.service;
package org.apache.cassandra.thrift;

import java.util.List;
import java.util.ArrayList;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
*/
package org.apache.cassandra.service;
package org.apache.cassandra.thrift;

import java.util.List;
import java.util.ArrayList;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
*/
package org.apache.cassandra.service;
package org.apache.cassandra.thrift;

import java.util.List;
import java.util.ArrayList;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
*/
package org.apache.cassandra.service;
package org.apache.cassandra.thrift;

import java.util.List;
import java.util.ArrayList;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
*/
package org.apache.cassandra.service;
package org.apache.cassandra.thrift;

import java.util.List;
import java.util.ArrayList;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
*/
package org.apache.cassandra.service;
package org.apache.cassandra.thrift;

import java.util.List;
import java.util.ArrayList;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
*/
package org.apache.cassandra.service;
package org.apache.cassandra.thrift;

import java.util.List;
import java.util.ArrayList;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
*/
package org.apache.cassandra.service;
package org.apache.cassandra.thrift;

import java.util.List;
import java.util.ArrayList;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
*/
package org.apache.cassandra.service;
package org.apache.cassandra.thrift;

import java.util.List;
import java.util.ArrayList;
Expand Down
6 changes: 3 additions & 3 deletions src/java/org/apache/cassandra/auth/AllowAllAuthenticator.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package org.apache.cassandra.auth;

import org.apache.cassandra.service.AuthenticationException;
import org.apache.cassandra.service.AuthenticationRequest;
import org.apache.cassandra.service.AuthorizationException;
import org.apache.cassandra.thrift.AuthenticationException;
import org.apache.cassandra.thrift.AuthenticationRequest;
import org.apache.cassandra.thrift.AuthorizationException;

public class AllowAllAuthenticator implements IAuthenticator
{
Expand Down
6 changes: 3 additions & 3 deletions src/java/org/apache/cassandra/auth/IAuthenticator.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package org.apache.cassandra.auth;

import org.apache.cassandra.service.AuthenticationException;
import org.apache.cassandra.service.AuthenticationRequest;
import org.apache.cassandra.service.AuthorizationException;
import org.apache.cassandra.thrift.AuthenticationException;
import org.apache.cassandra.thrift.AuthenticationRequest;
import org.apache.cassandra.thrift.AuthorizationException;

public interface IAuthenticator
{
Expand Down
3 changes: 3 additions & 0 deletions src/java/org/apache/cassandra/auth/SimpleAuthenticator.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
import java.util.Properties;

import org.apache.cassandra.service.*;
import org.apache.cassandra.thrift.AuthenticationException;
import org.apache.cassandra.thrift.AuthenticationRequest;
import org.apache.cassandra.thrift.AuthorizationException;

public class SimpleAuthenticator implements IAuthenticator
{
Expand Down
14 changes: 13 additions & 1 deletion src/java/org/apache/cassandra/cli/CliClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,21 @@

import org.antlr.runtime.tree.*;

import static org.apache.cassandra.service.ThriftGlue.*;
import static org.apache.cassandra.thrift.ThriftGlue.*;

import org.apache.cassandra.service.*;
import org.apache.cassandra.thrift.Cassandra;
import org.apache.cassandra.thrift.Column;
import org.apache.cassandra.thrift.ColumnOrSuperColumn;
import org.apache.cassandra.thrift.ColumnParent;
import org.apache.cassandra.thrift.ColumnPath;
import org.apache.cassandra.thrift.ConsistencyLevel;
import org.apache.cassandra.thrift.InvalidRequestException;
import org.apache.cassandra.thrift.NotFoundException;
import org.apache.cassandra.thrift.SliceRange;
import org.apache.cassandra.thrift.SuperColumn;
import org.apache.cassandra.thrift.TimedOutException;
import org.apache.cassandra.thrift.UnavailableException;

import java.util.*;
import java.io.UnsupportedEncodingException;
Expand Down
3 changes: 2 additions & 1 deletion src/java/org/apache/cassandra/cli/CliMain.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
import jline.*;
import java.io.*;

import org.apache.cassandra.service.Cassandra;
import org.apache.cassandra.thrift.Cassandra;

import static org.apache.cassandra.db.Table.SYSTEM_TABLE;

//
Expand Down
4 changes: 2 additions & 2 deletions src/java/org/apache/cassandra/client/RingCache.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
import java.net.InetAddress;
import java.net.UnknownHostException;

import org.apache.cassandra.service.Cassandra;
import org.apache.cassandra.service.CassandraServer;
import org.apache.cassandra.service.StorageService;
import org.apache.cassandra.thrift.Cassandra;
import org.apache.cassandra.thrift.CassandraServer;
import org.apache.log4j.Logger;
import org.apache.thrift.TException;
import org.apache.thrift.protocol.TBinaryProtocol;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

package org.apache.cassandra.db;

import org.apache.cassandra.service.InvalidRequestException;
import org.apache.cassandra.thrift.InvalidRequestException;

public class ColumnFamilyNotDefinedException extends InvalidRequestException
{
Expand Down
2 changes: 1 addition & 1 deletion src/java/org/apache/cassandra/db/ColumnFamilyStore.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
import org.apache.cassandra.cache.InstrumentedCache;
import org.apache.cassandra.cache.JMXAggregatingCache;
import org.apache.cassandra.cache.JMXInstrumentedCache;
import org.apache.cassandra.service.SliceRange;
import org.apache.log4j.Logger;

import org.apache.cassandra.config.DatabaseDescriptor;
Expand All @@ -47,6 +46,7 @@
import java.util.regex.Pattern;

import org.apache.cassandra.service.StorageService;
import org.apache.cassandra.thrift.SliceRange;
import org.apache.cassandra.utils.*;
import org.apache.cassandra.concurrent.JMXEnabledThreadPoolExecutor;
import org.apache.cassandra.concurrent.NamedThreadFactory;
Expand Down
1 change: 1 addition & 0 deletions src/java/org/apache/cassandra/db/HintedHandOffManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
import org.apache.cassandra.net.Message;
import org.apache.cassandra.net.MessagingService;
import org.apache.cassandra.service.*;
import org.apache.cassandra.thrift.InvalidRequestException;
import org.apache.cassandra.db.filter.IdentityQueryFilter;
import org.apache.cassandra.db.filter.QueryPath;
import org.apache.cassandra.utils.WrappedRunnable;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/
package org.apache.cassandra.db;

import org.apache.cassandra.service.InvalidRequestException;
import org.apache.cassandra.thrift.InvalidRequestException;

public class KeyspaceNotDefinedException extends InvalidRequestException
{
Expand Down
6 changes: 3 additions & 3 deletions src/java/org/apache/cassandra/db/RangeSliceCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@

import org.apache.cassandra.concurrent.StageManager;

import static org.apache.cassandra.service.ThriftGlue.createColumnParent;
import static org.apache.cassandra.thrift.ThriftGlue.createColumnParent;

import org.apache.cassandra.io.util.DataOutputBuffer;
import org.apache.cassandra.io.ICompactSerializer;
import org.apache.cassandra.net.Message;
import org.apache.cassandra.service.ColumnParent;
import org.apache.cassandra.service.SlicePredicate;
import org.apache.cassandra.service.StorageService;
import org.apache.cassandra.thrift.ColumnParent;
import org.apache.cassandra.thrift.SlicePredicate;
import org.apache.cassandra.utils.FBUtilities;
import org.apache.thrift.TDeserializer;
import org.apache.thrift.TException;
Expand Down
7 changes: 5 additions & 2 deletions src/java/org/apache/cassandra/db/RowMutation.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@
import org.apache.cassandra.io.ICompactSerializer;
import org.apache.cassandra.net.Message;
import org.apache.cassandra.service.*;
import org.apache.cassandra.thrift.ColumnOrSuperColumn;
import org.apache.cassandra.thrift.Deletion;
import org.apache.cassandra.thrift.Mutation;
import org.apache.cassandra.utils.FBUtilities;
import org.apache.cassandra.db.filter.QueryPath;
import org.apache.cassandra.config.DatabaseDescriptor;
Expand Down Expand Up @@ -246,7 +249,7 @@ public static RowMutation getRowMutation(String table, String key, Map<String, L
if (cosc.column == null)
{
assert cosc.super_column != null;
for (org.apache.cassandra.service.Column column : cosc.super_column.columns)
for (org.apache.cassandra.thrift.Column column : cosc.super_column.columns)
{
rm.add(new QueryPath(cfName, cosc.super_column.name, column.name), column.value, column.timestamp);
}
Expand Down Expand Up @@ -281,7 +284,7 @@ private static void addColumnOrSuperColumnToRowMutation(RowMutation rm, String c
{
if (cosc.column == null)
{
for (org.apache.cassandra.service.Column column : cosc.super_column.columns)
for (org.apache.cassandra.thrift.Column column : cosc.super_column.columns)
{
rm.add(new QueryPath(cfName, cosc.super_column.name, column.name), column.value, column.timestamp);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import java.io.IOException;
import java.util.*;

import org.apache.cassandra.service.ColumnParent;
import org.apache.cassandra.thrift.ColumnParent;
import org.apache.cassandra.db.filter.QueryPath;
import org.apache.cassandra.db.filter.NamesQueryFilter;

Expand Down
Loading

0 comments on commit 542bd79

Please sign in to comment.