[입 개발] Cassandra thrift Command map

Cassadra 의 경우 thrift를 이용해서 클라이언트와 통신을 하게됩니다.(Avro도 있지만 일단은 생략) 이 쪽 코드는 Command Pattern을 통해서 처리하게 되고, 각각의 Command는 processMap 이라는 곳에 저장됩니다. (interface/thrift/gen-java/Cassandra.java 에 존재)

    private static <I extends Iface> Map<String,  org.apache.thrift.ProcessFunction<I, ? extends  org.apache.thrift.TBase>> getProcessMap(Map<String,  org.apache.thrift.ProcessFunction<I, ? extends  org.apache.thrift.TBase>> processMap) {
      processMap.put("login", new login());
      processMap.put("set_keyspace", new set_keyspace());
      processMap.put("get", new get());
      processMap.put("get_slice", new get_slice());
      processMap.put("get_count", new get_count());
      processMap.put("multiget_slice", new multiget_slice());
      processMap.put("multiget_count", new multiget_count());
      processMap.put("get_range_slices", new get_range_slices());
      processMap.put("get_paged_slice", new get_paged_slice());
      processMap.put("get_indexed_slices", new get_indexed_slices());
      processMap.put("insert", new insert());
      processMap.put("add", new add());
      processMap.put("remove", new remove());
      processMap.put("remove_counter", new remove_counter());
      processMap.put("batch_mutate", new batch_mutate());
      processMap.put("atomic_batch_mutate", new atomic_batch_mutate());
      processMap.put("truncate", new truncate());
      processMap.put("describe_schema_versions", new describe_schema_versions());
      processMap.put("describe_keyspaces", new describe_keyspaces());
      processMap.put("describe_cluster_name", new describe_cluster_name());
      processMap.put("describe_version", new describe_version());
      processMap.put("describe_ring", new describe_ring());
      processMap.put("describe_token_map", new describe_token_map());
      processMap.put("describe_partitioner", new describe_partitioner());
      processMap.put("describe_snitch", new describe_snitch());
      processMap.put("describe_keyspace", new describe_keyspace());
      processMap.put("describe_splits", new describe_splits());
      processMap.put("trace_next_query", new trace_next_query());
      processMap.put("describe_splits_ex", new describe_splits_ex());
      processMap.put("system_add_column_family", new system_add_column_family());
      processMap.put("system_drop_column_family", new system_drop_column_family());
      processMap.put("system_add_keyspace", new system_add_keyspace());
      processMap.put("system_drop_keyspace", new system_drop_keyspace());
      processMap.put("system_update_keyspace", new system_update_keyspace());
      processMap.put("system_update_column_family", new system_update_column_family());
      processMap.put("execute_cql_query", new execute_cql_query());
      processMap.put("execute_cql3_query", new execute_cql3_query());
      processMap.put("prepare_cql_query", new prepare_cql_query());
      processMap.put("prepare_cql3_query", new prepare_cql3_query());
      processMap.put("execute_prepared_cql_query", new execute_prepared_cql_query());
      processMap.put("execute_prepared_cql3_query", new execute_prepared_cql3_query());
      processMap.put("set_cql_version", new set_cql_version());
      return processMap;
    }

혹시나 싶어서 저장해둡니다.