Codota Logo
me.prettyprint.cassandra.service
Code IndexAdd Codota to your IDE (free)

How to use me.prettyprint.cassandra.service

Best Java code snippets using me.prettyprint.cassandra.service (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Dictionary d =
  • Codota Iconnew Hashtable()
  • Codota IconBundle bundle;bundle.getHeaders()
  • Codota Iconnew Properties()
  • Smart code suggestions by Codota
}
origin: apache/usergrid

/**
 * Create a timestamp based on the TimeResolution set to the cluster.
 *
 * @return a timestamp
 */
public long createTimestamp() {
  return chc.getClockResolution().createClock();
}
origin: apache/usergrid

CassandraHost[] hosts = chc.buildCassandraHosts();
if ( hosts.length == 0 ) {
  throw new RuntimeException( "Fatal error: no Cassandra hosts configured" );
  if ( StringUtils.isEmpty( host.getHost() ) ) {
    throw new RuntimeException( "Fatal error: Cassandra hostname cannot be empty" );
  hostsString += host.getHost() + ",";
cpProps.put( "cassandra.port", hosts[0].getPort() );
origin: apache/usergrid

public static List<ColumnDefinition> getIndexMetadata( String indexes ) {
  if ( indexes == null ) {
    return null;
  }
  String[] index_entries = split( indexes, ',' );
  List<ColumnDef> columns = new ArrayList<ColumnDef>();
  for ( String index_entry : index_entries ) {
    String column_name = stringOrSubstringBeforeFirst( index_entry, ':' ).trim();
    String comparer = substringAfterLast( index_entry, ":" ).trim();
    if ( StringUtils.isBlank( comparer ) ) {
      comparer = "UUIDType";
    }
    if ( StringUtils.isNotBlank( column_name ) ) {
      ColumnDef cd = new ColumnDef( bytebuffer( column_name ), comparer );
      cd.setIndex_name( column_name );
      cd.setIndex_type( IndexType.KEYS );
      columns.add( cd );
    }
  }
  return ThriftColumnDef.fromThriftList( columns );
}
origin: hector-client/hector

 protected CassandraHostConfigurator getCHCForTest() {
  CassandraHostConfigurator chc = new CassandraHostConfigurator("127.0.0.1:9170");
  chc.setMaxActive(2);
  return chc;
 }
}
origin: hector-client/hector

 @Override
 public KeyspaceDefinition execute(Cassandra.Client cassandra)
 throws HectorException {
  try {
   return new ThriftKsDef(cassandra.describe_keyspace(keyspace));
  } catch (org.apache.cassandra.thrift.NotFoundException nfe) {
   setException(xtrans.translate(nfe));
   return null;
  } catch (Exception e) {
   throw xtrans.translate(e);
  }
 }
};
origin: hector-client/hector

public static ColumnFamilyDefinition createColumnFamilyDefinition(
  String keyspace, String cfName, ComparatorType comparatorType,
  List<ColumnDefinition> columnMetadata) {
 return new ThriftCfDef(keyspace, cfName, comparatorType, columnMetadata);
}
origin: hector-client/hector

@Override
public void batchMutate(BatchMutation batchMutate) throws HectorException {
 batchMutate(batchMutate.getMutationMap());
}
origin: hector-client/hector

@Override
public void batchMutate(BatchMutation batchMutate) throws HectorException {
 batchMutate(batchMutate.getMutationMap());
}
origin: hector-client/hector

 private ThriftKsDef toThriftImplementation(final KeyspaceDefinition cfdef) {
   if(cfdef instanceof ThriftKsDef) {
    return (ThriftKsDef) cfdef;
   } else {
    return new ThriftKsDef(cfdef);
   }
 }
}
origin: hector-client/hector

@Before
public void setupCase() throws TTransportException, TException, IllegalArgumentException,
    NotFoundException, UnknownHostException, Exception {
 cassandraHostConfigurator = getCHCForTest();
 cassandraCluster = new ThriftCluster(clusterName, cassandraHostConfigurator);
}
origin: hector-client/hector

@Override
public void executeAndSetResult(Client cassandra, CassandraHost cassandraHost)
  throws Exception {
 operation.executeAndSetResult(new VirtualKeyspaceCassandraClient(cassandra, prefixBytes), cassandraHost);
}
origin: hector-client/hector

@Override
public T execute(Client cassandra) throws Exception {
 return operation.execute(new VirtualKeyspaceCassandraClient(cassandra,
   prefixBytes));
}
origin: hector-client/hector

@Override
public Map<ByteBuffer, List<SuperColumn>> getSuperRangeSlices(
  ColumnParent columnParent, SlicePredicate predicate, KeyRange keyRange)
  throws HectorException {
 return ps.fromBytesMap(super.getSuperRangeSlices(columnParent, predicate,
   prefixKeyRange(keyRange)));
}
origin: hector-client/hector

/**
 * Makes a shallow copy of the mutation object.
 * @return
 */
public BatchMutation<K> makeCopy() {
 return new BatchMutation<K>(keySerializer, mutationMap, sizeHint);
}
origin: hector-client/hector

public Operation(OperationType operationType) {
 this.failCounter = (operationType == OperationType.READ) ? Counter.READ_FAIL :
  Counter.WRITE_FAIL;
 this.operationType = operationType;
 this.stopWatchTagName = operationType.name();
}
origin: hector-client/hector

@Override
public Builder maxRowCount(int maxRowCount) {
 super.maxRowCount(maxRowCount);
 return this;
}
origin: hector-client/hector

public static JmxMonitor getInstance() {
 if ( monitorInstance == null ) {
  monitorInstance = new JmxMonitor();
 }
 return monitorInstance;
}
origin: hector-client/hector

@Override
public void applyConnectionParams(String keyspace,
  ConsistencyLevelPolicy consistencyLevelPolicy,
  FailoverPolicy failoverPolicy, Map<String, String> credentials) {
 operation.applyConnectionParams(keyspace, consistencyLevelPolicy,
   failoverPolicy, credentials);
}
origin: apache/usergrid

/** Create the keyspace */
private void createKeySpace( String keyspace ) {
  logger.info( "Creating keyspace: {}", keyspace );
  String strategy_class =
      getString( properties, "cassandra.keyspace.strategy", "org.apache.cassandra.locator.SimpleStrategy" );
  logger.info( "Using strategy: {}", strategy_class );
  int replication_factor = getIntValue( properties, "cassandra.keyspace.replication", 1 );
  logger.info( "Using replication (may be overriden by strategy options): {}", replication_factor );
  // try {
  ThriftKsDef ks_def = ( ThriftKsDef ) HFactory
      .createKeyspaceDefinition( keyspace, strategy_class, replication_factor,
          new ArrayList<ColumnFamilyDefinition>() );
  @SuppressWarnings({ "unchecked", "rawtypes" }) Map<String, String> strategy_options =
      filter( ( Map ) properties, "cassandra.keyspace.strategy.options.", true );
  if ( strategy_options.size() > 0 ) {
    logger.info( "Strategy options: {}", mapToFormattedJsonString( strategy_options ) );
    ks_def.setStrategyOptions( strategy_options );
  }
  cluster.addKeyspace( ks_def );
  waitForCreation( keyspace );
  logger.info( "Created keyspace {}", keyspace );
}
origin: hector-client/hector

private BatchMutation<K> getPendingMutations() {
 if (pendingMutations == null) {
  pendingMutations = new BatchMutation<K>(keySerializer, sizeHint);
 }
 return pendingMutations;
}

me.prettyprint.cassandra.service

Most used classes

  • CassandraHostConfigurator
  • ThriftCfDef
  • CassandraHost
    Encapsulates the information required for connecting to a Cassandra host. Also exposes pool configur
  • ThriftKsDef
  • ColumnSliceIterator
    Iterates over the column slice, refreshing until all qualifing columns are retrieved. If column dele
  • HColumnFamilyImpl,
  • KeyIterator,
  • ColumnFamilyTemplate,
  • ColumnFamilyUpdater,
  • ThriftColumnFamilyTemplate,
  • IndexedSlicesIterator,
  • KeyIterator$Builder,
  • KeyspaceService,
  • RangeSlicesIterator,
  • ThriftCluster,
  • ThriftColumnDef,
  • BatchMutation,
  • CassandraClientMonitor,
  • ExceptionsTranslator
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now