test_class.declarator: LOG = LoggerFactory.getLogger(CassandraBoltTest.class)
test_class.modifier: private static
test_class.original_string: private static Logger LOG = LoggerFactory.getLogger(CassandraBoltTest.class);
test_class.type: Logger
test_class.var_name: LOG
test_class.declarator: KEYSPACE = CassandraBoltTest.class.getSimpleName().toLowerCase()
test_class.modifier: private static
test_class.original_string: private static String KEYSPACE = CassandraBoltTest.class.getSimpleName().toLowerCase();
test_class.type: String
test_class.var_name: KEYSPACE
test_class.file: storm/storm-cassandra/src/test/java/com/hmsonline/storm/cassandra/bolt/CassandraBoltTest.java
test_class.identifier: CassandraBoltTest
test_case.body: @Test
      public void testBolt() throws Exception {
          TupleMapper<String, String, String> tupleMapper = new DefaultTupleMapper(KEYSPACE, "users", "VALUE");
          String configKey = "cassandra-config";
          CassandraBatchingBolt<String, String, String> bolt = new CassandraBatchingBolt<String, String, String>(configKey, tupleMapper);
          TopologyBuilder builder = new TopologyBuilder();
          builder.setBolt("TEST_BOLT", bolt);
  
          Fields fields = new Fields("VALUE");
          TopologyContext context = new MockTopologyContext(builder.createTopology(), fields);
  
          Config config = new Config();
          config.put(Config.TOPOLOGY_MAX_SPOUT_PENDING, 5000);
          
          Map<String, Object> clientConfig = new HashMap<String, Object>();
          clientConfig.put(StormCassandraConstants.CASSANDRA_HOST, "localhost:9160");
          clientConfig.put(StormCassandraConstants.CASSANDRA_KEYSPACE, Arrays.asList(new String [] {KEYSPACE}));
          config.put(configKey, clientConfig);
  
          bolt.prepare(config, context, null);
          System.out.println("Bolt Preparation Complete.");
  
          Values values = new Values(42);
          Tuple tuple = new TupleImpl(context, values, 5, "test");
          bolt.execute(tuple);
  
          // wait very briefly for the batch to complete
          Thread.sleep(250);
  
          AstyanaxContext<Keyspace> astyContext = newContext("localhost:9160", KEYSPACE);
          Keyspace ks = astyContext.getEntity();
  
          Column<String> result = ks
                  .prepareQuery(new ColumnFamily<String, String>("users", StringSerializer.get(), StringSerializer.get()))
                  .getKey("42").getColumn("VALUE").execute().getResult();
          assertEquals("42", result.getStringValue());
  
      }
test_case.class_method_signature: CassandraBoltTest.testBolt()
test_case.full_signature: @Test public void testBolt()
test_case.identifier: testBolt
test_case.invocations: setBolt createTopology put put put asList put prepare println execute sleep newContext getEntity getResult execute getColumn getKey prepareQuery get get assertEquals getStringValue
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testBolt()
focal_class.declarator: LOG = LoggerFactory.getLogger(CassandraBolt.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger LOG = LoggerFactory.getLogger(CassandraBolt.class);
focal_class.type: Logger
focal_class.var_name: LOG
focal_class.declarator: clientConfigKey
focal_class.modifier: private
focal_class.original_string: private String clientConfigKey;
focal_class.type: String
focal_class.var_name: clientConfigKey
focal_class.declarator: client
focal_class.modifier: protected transient
focal_class.original_string: protected transient AstyanaxClient<K, C, V> client;
focal_class.type: AstyanaxClient<K, C, V>
focal_class.var_name: client
focal_class.declarator: tupleMapper
focal_class.modifier: protected
focal_class.original_string: protected TupleMapper<K, C, V> tupleMapper;
focal_class.type: TupleMapper<K, C, V>
focal_class.var_name: tupleMapper
focal_class.file: storm/storm-cassandra/src/main/java/com/hmsonline/storm/cassandra/bolt/CassandraBolt.java
focal_class.identifier: CassandraBolt
focal_class.interfaces: implements Serializable
focal_class.class_method_signature: CassandraBolt.CassandraBolt(String clientConfigKey, TupleMapper<K, C, V> tupleMapper)
focal_class.full_signature: public  CassandraBolt(String clientConfigKey, TupleMapper<K, C, V> tupleMapper)
focal_class.identifier: CassandraBolt
focal_class.modifiers: public
focal_class.parameters: (String clientConfigKey, TupleMapper<K, C, V> tupleMapper)
focal_class.signature:  CassandraBolt(String clientConfigKey, TupleMapper<K, C, V> tupleMapper)
focal_class.class_method_signature: CassandraBolt.prepare(Map<String, Object> stormConf, TopologyContext context)
focal_class.full_signature: @SuppressWarnings("unchecked") public void prepare(Map<String, Object> stormConf, TopologyContext context)
focal_class.identifier: prepare
focal_class.modifiers: @SuppressWarnings("unchecked") public
focal_class.parameters: (Map<String, Object> stormConf, TopologyContext context)
focal_class.return: void
focal_class.signature: void prepare(Map<String, Object> stormConf, TopologyContext context)
focal_class.class_method_signature: CassandraBolt.cleanup()
focal_class.full_signature: public void cleanup()
focal_class.identifier: cleanup
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void cleanup()
focal_class.class_method_signature: CassandraBolt.writeTuple(Tuple input, TupleMapper<K, C, V> tupleMapper)
focal_class.full_signature: public void writeTuple(Tuple input, TupleMapper<K, C, V> tupleMapper)
focal_class.identifier: writeTuple
focal_class.modifiers: public
focal_class.parameters: (Tuple input, TupleMapper<K, C, V> tupleMapper)
focal_class.return: void
focal_class.signature: void writeTuple(Tuple input, TupleMapper<K, C, V> tupleMapper)
focal_class.class_method_signature: CassandraBolt.writeTuples(List<Tuple> inputs, TupleMapper<K, C, V> tupleMapper)
focal_class.full_signature: public void writeTuples(List<Tuple> inputs, TupleMapper<K, C, V> tupleMapper)
focal_class.identifier: writeTuples
focal_class.modifiers: public
focal_class.parameters: (List<Tuple> inputs, TupleMapper<K, C, V> tupleMapper)
focal_class.return: void
focal_class.signature: void writeTuples(List<Tuple> inputs, TupleMapper<K, C, V> tupleMapper)
focal_class.class_method_signature: CassandraBolt.getComponentConfiguration()
focal_class.full_signature: public Map<String, Object> getComponentConfiguration()
focal_class.identifier: getComponentConfiguration
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: Map<String, Object>
focal_class.signature: Map<String, Object> getComponentConfiguration()
focal_class.class_method_signature: CassandraBolt.incrementCounter(Tuple input, TupleCounterMapper tupleMapper)
focal_class.full_signature: public void incrementCounter(Tuple input, TupleCounterMapper tupleMapper)
focal_class.identifier: incrementCounter
focal_class.modifiers: public
focal_class.parameters: (Tuple input, TupleCounterMapper tupleMapper)
focal_class.return: void
focal_class.signature: void incrementCounter(Tuple input, TupleCounterMapper tupleMapper)
focal_class.class_method_signature: CassandraBolt.incrementCounters(List<Tuple> inputs, TupleCounterMapper tupleMapper)
focal_class.full_signature: public void incrementCounters(List<Tuple> inputs, TupleCounterMapper tupleMapper)
focal_class.identifier: incrementCounters
focal_class.modifiers: public
focal_class.parameters: (List<Tuple> inputs, TupleCounterMapper tupleMapper)
focal_class.return: void
focal_class.signature: void incrementCounters(List<Tuple> inputs, TupleCounterMapper tupleMapper)
focal_method.body: @SuppressWarnings("unchecked")
      public void prepare(Map<String, Object> stormConf, TopologyContext context) {
          Map<String, Object> config = (Map<String, Object>) stormConf.get(this.clientConfigKey);
          this.client = new AstyanaxClient<K, C, V>();
          this.client.start(config);
      }
focal_method.class_method_signature: CassandraBolt.prepare(Map<String, Object> stormConf, TopologyContext context)
focal_method.full_signature: @SuppressWarnings("unchecked") public void prepare(Map<String, Object> stormConf, TopologyContext context)
focal_method.identifier: prepare
focal_method.invocations: get start
focal_method.modifiers: @SuppressWarnings("unchecked") public
focal_method.parameters: (Map<String, Object> stormConf, TopologyContext context)
focal_method.return: void
focal_method.signature: void prepare(Map<String, Object> stormConf, TopologyContext context)