Ashu Gupta | 16 May 2013 08:11
Picon

How to retrieve data from cassandra

I am working on cassandra 1.2.3 and using hector 1.1-3 When I fetch columns using SliceQuery, it returns me all the columns with the same datatype. Is there any way that QueryResult have object as the datatype of column values? If I use bytebuffer , So if I want to return multiple columns containing different data types(as a wrapper method over Hector), what data type do I return from my wrapper method?? I obviously won't know which column will have which data type & I can't return ByteBuffer as a generic column value type. Can anyone help me out with this?

--
You received this message because you are subscribed to the Google Groups "hector-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hector-users+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Codevally | 16 May 2013 09:10
Picon
Gravatar

HUnavailableException: : May not be enough replicas present to handle consistency level.

Hi


I have 4 nodes Cassandra cluster in production with 1.0.11 version (hector 1.0.5).

Keyspace: MessageCache:
  Replication Strategy: org.apache.cassandra.locator.SimpleStrategy
  Durable Writes: true
    Options: [replication_factor:4]
  Column Families:
    ColumnFamily: MessageData
      Key Validation Class: org.apache.cassandra.db.marshal.BytesType
      Default column value validator: org.apache.cassandra.db.marshal.BytesType
      Columns sorted by: org.apache.cassandra.db.marshal.BytesType
      Row cache size / save period in seconds / keys to save : 0.0/0/all
      Row Cache Provider: org.apache.cassandra.cache.ConcurrentLinkedHashCacheProvider
      Key cache size / save period in seconds: 20000.0/3600
      GC grace seconds: 3600
      Compaction min/max thresholds: 4/32
      Read repair chance: 1.0
      Replicate on write: true
      Bloom Filter FP chance: default
      Built indexes: []
      Compaction Strategy: org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy

To increase the number of cores, I shutdown one Cassandra node and suddenly I got this exception.

me.prettyprint.hector.api.exceptions.HUnavailableException: : May not be enough replicas present to handle consistency level.

I have not mention any consistency level, so by default it should be QUORAM. 

According to the documentation, cluster can be survive with 3 live nodes (even one node goes offline), because of my replication factor RF=4.

If so why I am hitting this error?

Thanks

Roshan

   

--
You received this message because you are subscribed to the Google Groups "hector-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hector-users+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.
 
 
avinsemail | 15 May 2013 20:39
Picon

Row Level Isolation

I am new to Cassandra and have been using the Hector Template API's. My question here is how do I use Row Level Isolation when I am trying to update. 


My typical get looks something like:

 public String getAttributeValueForKey( String columnName, String key ) throws StoreException {


        String result = null;

        try {

            ColumnFamilyResult<String, String> columnFamilyResult = getTemplate().queryColumns( key );

            if( null != columnFamilyResult ) {

                result = columnFamilyResult.getString( columnName );

            }

        }

        catch( HectorException e ) {

            LOGGER.error( e );

            throw new StoreException( e );

        }


        return result;

    }


And the puts looks something like:

  public void putKeyWithValuesAndTimeout( String rowKey, Map<String, String> columns, long timeInMilliSeconds ) throws StoreException {


        ColumnFamilyUpdater<String, String> updater = getTemplate().createUpdater(rowKey);

        for( String attributeKey : columns.keySet() ) {

            HColumn<String, String> column = new HColumnImpl<String,String>(StringSerializer.get(), StringSerializer.get());

            column.setClock(getTemplate().getClock());

            column.setName(attributeKey);

            column.setValue( columns.get(attributeKey));

            column.setTtl((int)timeInMilliSeconds);


            updater.setColumn(column);

        }

        try {

            getTemplate().update( updater );

        }

        catch( HectorException e ) {

            LOGGER.error( e );

            throw new StoreException( e );

        }

    }




--
You received this message because you are subscribed to the Google Groups "hector-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hector-users+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Rafael Neves | 15 May 2013 18:53
Picon
Gravatar

[Firebrand] - MappedCollection objects on WHERE clauses

Hi people,

I trying using a object annotated with <at> MappedCollection on WHERE clausre of my SELECT.

this is possible? how?

SELECT * FROM ColumnFamilys WHERE ColumnFamilys .dinamycColumn.nomeColuna = 'estoque2'";

class:ColumnFamilys 
public class ColumnFamilys
{
<at> Key
private String id;

private String name;

<at> MappedCollection(lazy=false)
private List<DinamycColumn> dinamycColumns;
...
}

--
You received this message because you are subscribed to the Google Groups "hector-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hector-users+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Leandro Rodrigues Silva | 14 May 2013 16:24
Picon

Hector Object Mapper

Hello guys!!!


I'm trying to use the Hector Object Mapper, but i can't find the link of the download. When i configure que POM, the maven can't find the dependency. This is my configuration:

<dependency>
<groupId>org.hectorclient</groupId>
<artifactId>hector</artifactId>
<version>1.1-3</version>
</dependency>


This is right?


Any ideas?

Thanks a lot!

--
You received this message because you are subscribed to the Google Groups "hector-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hector-users+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Rafael Neves | 13 May 2013 19:54
Picon
Gravatar

Firebrind OCM

Hi guys,


I trying retrieve all data on my column family using method persistenceFactory.getColumns("Geral2", "b25b4b70-bbd2-11e2-8f3e-90b11cf59ca2",false, "dinName", "dinEnd"); 

this don't work when I have created my column family using follow method:  persistenceFactory.executeQuery(Integer.class, Query.get(createColumnFamily(
columnFamily("Geral2"),
   columnDefinitions(
       primaryKey("myKey", ColumnDataType.UUID),
       column("dinName", ColumnDataType.TEXT),
       column("dinEnd", ColumnDataType.TEXT)
   ),
   storageOptions(
       storageOption(StorageParameter.COMMENT, "comment"),
       storageOption(StorageParameter.READ_REPAIR_CHANCE, "1")
   )
)));

so, I create this index:
persistenceFactory.executeQuery(Integer.class, Query.get(createIndex(
onColumnFamily("Geral2"),
indexName("myIndex"),
column("dinName")
)));

but I have the follow error:
Exception in thread "main" me.prettyprint.hector.api.exceptions.HInvalidRequestException: InvalidRequestException(why:No indexed columns present in by-columns clause with "equals" operator)


in cassandra-cli I see the index created.

any suggestion or solution, please?


--
You received this message because you are subscribed to the Google Groups "hector-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hector-users+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Alexandr S. | 10 May 2013 23:25
Picon

Insert column DateType value

How to insert DateType value from Hector client in columnfamily? Is need any external  library?

Thanks

--
You received this message because you are subscribed to the Google Groups "hector-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hector-users+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Paul Monday | 10 May 2013 20:52

CQL 3 Inserting Data w/ Composite Keys

I am trying to use CQL3 through the Hector API.  I've had some limited successes, but they are matched and exceeded by failures :(  Some successes include:  Insertion of data with UUID keys through the Mutator, limited query successes.


Right now I'm trying to insert to a CQL3 table with a composite key, am I pushing CQL3 through Hector too hard?  I'm using
   <dependency>
  <groupId>org.hectorclient</groupId>
  <artifactId>hector-core</artifactId>
  <version>1.1-3</version>
  </dependency>

Here is the table created in cqlsh -3
CREATE TABLE providers (providerid uuid, providername text, providertype text, active int, data text, primary key (providerid, providername, providertype, active)) WITH COMPACT STORAGE;

And here is an insert off the command line:
cqlsh:consumerinformation_3_0> insert into providers (providerid, providername, providertype, active, data) values (603db8fa-a2b7-4744-b568-11a2722f2042, 'M', 'Z', 0, 'data');
cqlsh:consumerinformation_3_0> select * from providers;

 providerid                           | providername | providertype | active | data
--------------------------------------+--------------+--------------+--------+------
 603db8fa-a2b7-4744-b568-11a2722f2042 |            M |            Z |      0 | data

cqlsh:consumerinformation_3_0> 

Yay, it works in cqlsh.

But, translating this to the Hector Client has proven to be a bit of a mess.  I've tried a CqlQuery, but this results in a 
12:45:56,115 DEBUG HomeTemplate:68 - Query String: insert into providers (providername, providertype, active, providerid) VALUES('M', 'C', 0, efde8f8a-9c3e-4547-99a8-b33eccdd7b2b)
Exception in thread "main" me.prettyprint.hector.api.exceptions.HInvalidRequestException: InvalidRequestException(why:Expected key 'PROVIDERID' to be present in WHERE clause for 'providers')

Here is the code:

CqlQuery<String, String, String> cqlQuery = new CqlQuery<String, String, String>(keyspace, se, se, se);
cqlQuery.setQuery(getInsertQuery(newProvider));
QueryResult<CqlRows<String, String, String>> result = cqlQuery.execute();
return newProvider;

So, I went to the Mutator Approach, but this gave me

Exception in thread "main" me.prettyprint.hector.api.exceptions.HInvalidRequestException: InvalidRequestException(why:UUIDs must be exactly 16 bytes)

 Mutator<Composite> providerMutator = HFactory.createMutator(keyspace,

                CompositeSerializer.get());

        Composite rowKey = new Composite();

        rowKey.add(0, newProvider.getProviderName());

        rowKey.add(1, newProvider.getProviderType());

        rowKey.add(2, newProvider.getActive());

        rowKey.add(3, newProvider.getProviderId());

        providerMutator.addInsertion(rowKey, columnFamily

HFactory.createColumn("data", "Data",

StringSerializer.get(), StringSerializer.get()));


        logger.debug("Saving Provider: "

                + newProvider.toString() + " to " 

        + keyspaceId + ", " + columnFamily);

        // insertColumns(providerMutator, rowKey, columnFamily, newProvider);

        providerMutator.execute();

        return newProvider;


--
You received this message because you are subscribed to the Google Groups "hector-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hector-users+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.
 
 
lewismc | 8 May 2013 23:30
Picon
Gravatar

[ANNOUNCEMENT] Apache Gora 0.3 Released

Good Afternoon Everyone,

The Apache Gora team are proud to announce the release of Gora 0.3.
The Apache Gora open source framework provides an in-memory data model and persistence for big data. Gora supports persisting to column stores, key value stores, document stores and RDBMSs, and analyzing the data with extensive Apache Hadoop™ MapReduce support. Gora uses the Apache Software License v2.0.

Gora currently uses Hector Client as the underlying Cassandra client and we have been working to make sure that the gora-cassandra module was improved within this release.

This point release offers users significant improvements to a number of modules including a number of bug fixes, however of significant interest to the DynamoDB community will be the addition of a gora-dynamodb datastore for mapping and persisting objects to Amazon's DynamoDB [0]. Additionally the release includes various improvements to the gora-core module and a new Web Services API implementation which enables users to extend Gora to any cloud storage platform. A full list of changes in this release can be seen here [1].

You can grab the maven release artifacts from Maven Central and can also get the Gora sources from our download page [2]

A full PMC announcement can be seen in our news feed here [3].

Thank you have a great week.
Kind Regards
Lewis
(on behalf of the Apache Gora project and community)

[0] http://aws.amazon.com/dynamodb/
[1] http://www.apache.org/dist/gora/0.3/CHANGES.txt
[2] http://gora.staging.apache.org/downloads.html
[3] http://gora.staging.apache.org/index.html

--
You received this message because you are subscribed to the Google Groups "hector-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hector-users+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Sumit Thakur | 4 May 2013 09:32
Picon

Got OOM in cassandra while inserting data(size = 1MB)

Hello All,


I am getting OOM in cassandra 1.1.5 while trying to insert/read  data using Hector Api  .

 
No. of  rows = 1000
No. of Super columns = 20
No. of  columns = 10
column value size =  1MB
 

Thrift:17 
  at java.lang.OutOfMemoryError.<init>()V (OutOfMemoryError.java:25) 
  at org.apache.cassandra.io.util.RandomAccessReader.readBytes(I)Ljava/nio/ByteBuffer; (RandomAccessReader.java:323) 
  at org.apache.cassandra.utils.ByteBufferUtil.read(Ljava/io/DataInput;I)Ljava/nio/ByteBuffer; (ByteBufferUtil.java:398) 
  at org.apache.cassandra.utils.ByteBufferUtil.readWithLength(Ljava/io/DataInput;)Ljava/nio/ByteBuffer; (ByteBufferUtil.java:363) 
  at org.apache.cassandra.db.ColumnSerializer.deserialize(Ljava/io/DataInput;Lorg/apache/cassandra/io/IColumnSerializer$Flag;I)Lorg/apache/cassandra/db/Column; (ColumnSerializer.java:125) 
  at org.apache.cassandra.io.util.ColumnIterator.deserializeNext()Lorg/apache/cassandra/db/IColumn; (ColumnSortedMap.java:255) 
  at org.apache.cassandra.io.util.ColumnIterator.next()Ljava/util/Map$Entry; (ColumnSortedMap.java:275) 
  at org.apache.cassandra.io.util.ColumnIterator.next()Ljava/lang/Object; (ColumnSortedMap.java:232) 
  at edu.stanford.ppl.concurrent.SnapTreeMap.<init>(Ljava/util/SortedMap;)V (SnapTreeMap.java:453) 
  at org.apache.cassandra.db.AtomicSortedColumns$Holder.<init>(Ljava/util/SortedMap;)V (AtomicSortedColumns.java:311) 
  at org.apache.cassandra.db.AtomicSortedColumns.<init>(Ljava/util/SortedMap;)V (AtomicSortedColumns.java:77) 
  at org.apache.cassandra.db.AtomicSortedColumns.<init>(Ljava/util/SortedMap;Lorg/apache/cassandra/db/AtomicSortedColumns$1;)V (AtomicSortedColumns.java:48) 
  at org.apache.cassandra.db.AtomicSortedColumns$1.fromSorted(Ljava/util/SortedMap;Z)Lorg/apache/cassandra/db/ISortedColumns; (AtomicSortedColumns.java:61) 
  at org.apache.cassandra.db.SuperColumnSerializer.deserialize(Ljava/io/DataInput;Lorg/apache/cassandra/io/IColumnSerializer$Flag;I)Lorg/apache/cassandra/db/IColumn; (SuperColumn.java:399) 
  at org.apache.cassandra.db.SuperColumnSerializer.deserialize(Ljava/io/DataInput;Lorg/apache/cassandra/io/IColumnSerializer$Flag;)Lorg/apache/cassandra/db/IColumn; (SuperColumn.java:382) 
  at org.apache.cassandra.db.SuperColumnSerializer.deserialize(Ljava/io/DataInput;)Lorg/apache/cassandra/db/IColumn; (SuperColumn.java:377) 
  at org.apache.cassandra.db.SuperColumnSerializer.deserialize(Ljava/io/DataInput;)Ljava/lang/Object; (SuperColumn.java:339) 
  at org.apache.cassandra.db.columniterator.SimpleSliceReader.computeNext()Lorg/apache/cassandra/db/IColumn; (SimpleSliceReader.java:79) 
  at org.apache.cassandra.db.columniterator.SimpleSliceReader.computeNext()Ljava/lang/Object; (SimpleSliceReader.java:39) 
  at com.google.common.collect.AbstractIterator.tryToComputeNext()Z (AbstractIterator.java:140) 
  at com.google.common.collect.AbstractIterator.hasNext()Z (AbstractIterator.java:135) 
  at org.apache.cassandra.db.columniterator.SSTableSliceIterator.hasNext()Z (SSTableSliceIterator.java:116) 
  at org.apache.cassandra.utils.MergeIterator$Candidate.advance()Z (MergeIterator.java:147) 
  at org.apache.cassandra.utils.MergeIterator$ManyToOne.advance()V (MergeIterator.java:126) 
  at org.apache.cassandra.utils.MergeIterator$ManyToOne.computeNext()Ljava/lang/Object; (MergeIterator.java:100) 
  at com.google.common.collect.AbstractIterator.tryToComputeNext()Z (AbstractIterator.java:140) 
  at com.google.common.collect.AbstractIterator.hasNext()Z (AbstractIterator.java:135) 
  at org.apache.cassandra.db.filter.SliceQueryFilter.collectReducedColumns(Lorg/apache/cassandra/db/IColumnContainer;Ljava/util/Iterator;I)V (SliceQueryFilter.java:117) 
  at org.apache.cassandra.db.filter.QueryFilter.collateColumns(Lorg/apache/cassandra/db/ColumnFamily;Ljava/util/List;I)V (QueryFilter.java:140) 
  at org.apache.cassandra.db.RowIteratorFactory$2.getReduced()Lorg/apache/cassandra/db/Row; (RowIteratorFactory.java:107) 
  at org.apache.cassandra.db.RowIteratorFactory$2.getReduced()Ljava/lang/Object; (RowIteratorFactory.java:80) 
  at org.apache.cassandra.utils.MergeIterator$ManyToOne.consume()Ljava/lang/Object; (MergeIterator.java:118) 
  at org.apache.cassandra.utils.MergeIterator$ManyToOne.computeNext()Ljava/lang/Object; (MergeIterator.java:101) 
  at com.google.common.collect.AbstractIterator.tryToComputeNext()Z (AbstractIterator.java:140) 
  at com.google.common.collect.AbstractIterator.hasNext()Z (AbstractIterator.java:135) 
  at org.apache.cassandra.db.ColumnFamilyStore$2.computeNext()Lorg/apache/cassandra/db/Row; (ColumnFamilyStore.java:1381) 
  at org.apache.cassandra.db.ColumnFamilyStore$2.computeNext()Ljava/lang/Object; (ColumnFamilyStore.java:1377) 
  at com.google.common.collect.AbstractIterator.tryToComputeNext()Z (AbstractIterator.java:140) 
  at com.google.common.collect.AbstractIterator.hasNext()Z (AbstractIterator.java:135) 
  at org.apache.cassandra.db.ColumnFamilyStore.filter(Lorg/apache/cassandra/db/ColumnFamilyStore$AbstractScanIterator;Lorg/apache/cassandra/db/filter/ExtendedFilter;)Ljava/util/List; (ColumnFamilyStore.java:1454) 
  at org.apache.cassandra.db.ColumnFamilyStore.getRangeSlice(Ljava/nio/ByteBuffer;Lorg/apache/cassandra/dht/AbstractBounds;ILorg/apache/cassandra/db/filter/IFilter;Ljava/util/List;ZZ)Ljava/util/List; (ColumnFamilyStore.java:1433) 
  at org.apache.cassandra.service.RangeSliceVerbHandler.executeLocally(Lorg/apache/cassandra/db/RangeSliceCommand;)Ljava/util/List; (RangeSliceVerbHandler.java:50) 
  at org.apache.cassandra.service.StorageProxy.getRangeSlice(Lorg/apache/cassandra/db/RangeSliceCommand;Lorg/apache/cassandra/thrift/ConsistencyLevel;)Ljava/util/List; (StorageProxy.java:870) 
  at org.apache.cassandra.thrift.CassandraServer.get_range_slices(Lorg/apache/cassandra/thrift/ColumnParent;Lorg/apache/cassandra/thrift/SlicePredicate;Lorg/apache/cassandra/thrift/KeyRange;Lorg/apache/cassandra/thrift/ConsistencyLevel;)Ljava/util/List; (CassandraServer.java:691) 
  at org.apache.cassandra.thrift.Cassandra$Processor$get_range_slices.getResult(Lorg/apache/cassandra/thrift/Cassandra$Iface;Lorg/apache/cassandra/thrift/Cassandra$get_range_slices_args;)Lorg/apache/cassandra/thrift/Cassandra$get_range_slices_result; (Cassandra.java:3008) 
  at org.apache.cassandra.thrift.Cassandra$Processor$get_range_slices.getResult(Ljava/lang/Object;Lorg/apache/thrift/TBase;)Lorg/apache/thrift/TBase; (Cassandra.java:2996) 
  at org.apache.thrift.ProcessFunction.process(ILorg/apache/thrift/protocol/TProtocol;Lorg/apache/thrift/protocol/TProtocol;Ljava/lang/Object;)V (ProcessFunction.java:32) 
  at org.apache.thrift.TBaseProcessor.process(Lorg/apache/thrift/protocol/TProtocol;Lorg/apache/thrift/protocol/TProtocol;)Z (TBaseProcessor.java:34) 
  at org.apache.cassandra.thrift.CustomTThreadPoolServer$WorkerProcess.run()V (CustomTThreadPoolServer.java:186) 
  at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Ljava/lang/Runnable;)V (ThreadPoolExecutor.java:886) 
  at java.util.concurrent.ThreadPoolExecutor$Worker.run()V (ThreadPoolExecutor.java:908) 
  at java.lang.Thread.run()V (Thread.java:662) 


SUMIT THAKUR

--
You received this message because you are subscribed to the Google Groups "hector-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hector-users+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.
 
 
月张 | 2 May 2013 14:40
Picon

same code, differnet running time

we have 4 node (8core + 32GB):node A: client,node B、C、D: cassandra node.


i write some test code for inserting 100w row keys by multe threads , and got some problems:

sometimes, the slowest thread elapsed time 26s, 
sometimes, need 202s , 
and worst case, i got 'All host pools marked down. Retry burden pushed out to client.' exception.

i don't know why, and what can i do for it.
my code below:


public class HectorTest {

static String clusterName = "test-cluster";
static String keyspace = "ks1";
static String cfName = "cf1";
static Cluster cluster = HFactory.getOrCreateCluster(clusterName, "node-B:9160,node-C:9160,node-D:9160");
static Keyspace ksp = HFactory.createKeyspace(keyspace, cluster);
static final int BATCH_SIZE = 5000;

public static void main(String[] args) {
System.out.println(cluster.getKnownPoolHosts(true));

final HectorTest t = new HectorTest();
// t.createKeySpaceAndCf();

final int MAX_THREAD = Integer.parseInt(args[0]);
final int MAX_RECORD = Integer.parseInt(args[1]);

System.out.println("total record: " + MAX_RECORD * MAX_THREAD);
ExecutorService exec = Executors.newFixedThreadPool(MAX_THREAD);

for (int i = 0; i < MAX_THREAD; i++) {
final int threadIndex = i;
Thread thread = new Thread(new Runnable() {
public void run() {
t.batchInsert(threadIndex, MAX_RECORD, BATCH_SIZE);
}
});
exec.execute(thread);

}
exec.shutdown();
while (!exec.isTerminated()) {
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
cluster.getConnectionManager().shutdown();
}

public void batchInsert(int threadIndex, int count, int batchSize) {

long s = System.currentTimeMillis();
Mutator<String> m = HFactory.createMutator(ksp, StringSerializer.get());
int index = 0;
for (int i = 0; i < count; i++) {
m.addInsertion("rowkey-" + threadIndex + "-" + RandomStringUtils.random(3) + i, cfName, HFactory.createStringColumn(RandomStringUtils.random(10), RandomStringUtils.random(100)));
if (index++ % batchSize == 0) {
m.execute();
index = 0;
}
}
m.execute();
System.out.printf("thread %d %d \n", threadIndex, (System.currentTimeMillis() - s) / 1000);
}
 
}



P.S. the load of the node is very low, "load average: 0.25, 0.20, 0.18"







--
You received this message because you are subscribed to the Google Groups "hector-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hector-users+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Gmane