code stringlengths 73 34.1k | label stringclasses 1
value |
|---|---|
void addValue(String columnName, String value)
{
addValue(columnNames.indexOf(columnName), value);
} | java |
void addValue(int columnIndex, String value)
{
if ( (columnIndex < 0) || (columnIndex >= data.size()) )
{
throw new IllegalArgumentException();
}
List<String> stringList = data.get(columnIndex);
stringList.add(value);
} | java |
List<String> generate()
{
List<String> lines = Lists.newArrayList();
StringBuilder workStr = new StringBuilder();
List<AtomicInteger> columnWidths = getColumnWidths();
List<Iterator<String>> dataIterators = getDataIterators();
Iterator<AtomicInteger> columnWidthIterator = c... | java |
public static void start(Class<?> mainClass, final String[] args) {
try {
LifecycleInjector.bootstrap(mainClass, new AbstractModule() {
@Override
protected void configure() {
bind(String[].class).annotatedWith(Main.class).toInstance(args);
... | java |
public void output(Logger log)
{
Map<String, Entry> entries = config.getSortedEntries();
if ( entries.isEmpty() )
{
return;
}
ColumnPrinter printer = build(entries);
log.debug("Configuration Details");
for ( String line : printer.generat... | java |
public void output(PrintWriter out)
{
Map<String, Entry> entries = config.getSortedEntries();
if ( entries.isEmpty() )
{
return;
}
ColumnPrinter printer = build(entries);
out.println("Configuration Details");
printer.print(out);
} | java |
private ColumnPrinter build(Map<String, Entry> entries)
{
ColumnPrinter printer = new ColumnPrinter();
printer.addColumn("PROPERTY");
printer.addColumn("FIELD");
printer.addColumn("DEFAULT");
printer.addColumn("VALUE");
printer.addColumn("DESCRIPTION");
Map<... | java |
public static List<ConfigurationKeyPart> parse(String raw, Map<String, String> contextOverrides)
{
List<ConfigurationKeyPart> parts = Lists.newArrayList();
int caret = 0;
for (; ; )
{
int startIndex = raw.indexOf("${", caret);
if ( startIndex < 0 )
... | java |
@Deprecated
public void add(Object... objects) throws Exception
{
for ( Object obj : objects )
{
add(obj);
}
} | java |
@Deprecated
public void add(Object obj) throws Exception
{
add(obj, null, new LifecycleMethods(obj.getClass()));
} | java |
public LifecycleState getState(Object obj)
{
LifecycleStateWrapper lifecycleState = objectStates.get(obj);
if ( lifecycleState == null )
{
return hasStarted() ? LifecycleState.ACTIVE : LifecycleState.LATENT;
}
else {
synchronized(lifecycleState) {
... | java |
public String getKey(Map<String, String> variableValues)
{
StringBuilder key = new StringBuilder();
for ( ConfigurationKeyPart p : parts )
{
if ( p.isVariable() )
{
String value = variableValues.get(p.getValue());
if ( value == null )
... | java |
public Collection<String> getVariableNames()
{
ImmutableSet.Builder<String> builder = ImmutableSet.builder();
for ( ConfigurationKeyPart p : parts )
{
if ( p.isVariable() )
{
builder.add(p.getValue());
}
}
return builder.bu... | java |
public Injector createChildInjector(Collection<Module> modules)
{
Injector childInjector;
Collection<Module> localModules = modules;
for (ModuleTransformer transformer : transformers) {
localModules = transformer.call(localModules);
}
//noinspection depr... | java |
public Injector createInjector(Collection<Module> additionalModules)
{
List<Module> localModules = Lists.newArrayList();
// Add the discovered modules FIRST. The discovered modules
// are added, and will subsequently be configured, in module dependency
// order which will ... | java |
public void stop() {
stopWrites();
stopReads();
if (timerRef != null && timerRef.get() != null) {
timerRef.get().shutdownNow();
timerRef.set(null);
}
ndBenchMonitor.resetStats();
} | java |
public String nonPipelineRead(String key) throws Exception {
String res = jedisClient.get().get(key);
if (res != null) {
if (res.isEmpty()) {
throw new Exception("Data retrieved is not ok ");
}
} else {
return CacheMiss;
}
re... | java |
public String pipelineRead(String key, int max_pipe_keys, int min_pipe_keys) throws Exception {
int pipe_keys = randomGenerator.nextInt(max_pipe_keys);
pipe_keys = Math.max(min_pipe_keys, pipe_keys);
DynoJedisPipeline pipeline = this.jedisClient.get().pipelined();
Map<String, Response<... | java |
public String pipelineReadHGETALL(String key, String hm_key_prefix) throws Exception {
DynoJedisPipeline pipeline = jedisClient.get().pipelined();
Response<Map<byte[], byte[]>> resp = pipeline.hgetAll((hm_key_prefix + key).getBytes());
pipeline.sync();
if (resp == null || resp.get() == n... | java |
public String nonPipelineZRANGE(String key, int max_score) {
StringBuilder sb = new StringBuilder();
// Return all elements
Set<String> returnEntries = this.jedisClient.get().zrange(key, 0, -1);
if (returnEntries.isEmpty()) {
logger.error("The number of entries in the sorted ... | java |
public String nonpipelineWrite(String key, DataGenerator dataGenerator) {
String value = key + "__" + dataGenerator.getRandomValue() + "__" + key;
String result = this.jedisClient.get().set(key, value);
if (!"OK".equals(result)) {
logger.error("SET_ERROR: GOT " + result + " for SET ... | java |
public String pipelineWrite(String key, DataGenerator dataGenerator, int max_pipe_keys, int min_pipe_keys)
throws Exception {
// Create a random key between [0,MAX_PIPE_KEYS]
int pipe_keys = randomGenerator.nextInt(max_pipe_keys);
// Make sure that the number of keys in the pipeline... | java |
public String pipelineWriteHMSET(String key, DataGenerator dataGenerator, String hm_key_prefix) {
Map<String, String> map = new HashMap<>();
String hmKey = hm_key_prefix + key;
map.put((hmKey + "__1"), (key + "__" + dataGenerator.getRandomValue() + "__" + key));
map.put((hmKey + "__2"), ... | java |
public String nonPipelineZADD(String key, DataGenerator dataGenerator, String z_key_prefix, int max_score)
throws Exception {
String zKey = z_key_prefix + key;
int success = 0;
long returnOp = 0;
for (int i = 0; i < max_score; i++) {
returnOp = jedisClient.get().... | java |
@Override
public synchronized void init(DataGenerator dataGenerator) throws Exception {
if (esConfig.getRestClientPort() == 443 && !esConfig.isHttps()) {
throw new IllegalArgumentException(
"You must set the configuration property 'https' to true if you use the https default ... | java |
public static String humanReadableByteCount(final long bytes)
{
final int base = 1024;
// When using the smallest unit no decimal point is needed, because it's the exact number.
if (bytes < base) {
return bytes + " " + BINARY_UNITS[0];
}
final int exponent = (in... | java |
static String constructIndexName(String indexName, int indexRollsPerDay, Date date) {
if (indexRollsPerDay > 0) {
ZonedDateTime zdt = ZonedDateTime.ofInstant(date.toInstant(), ZoneId.of("UTC"));
int minutesPerRoll = 1440 / indexRollsPerDay;
int minutesElapsedSinceStartOfDay ... | java |
public List<String> readBulk(final List<String> keys) throws Exception {
List<String> responses = new ArrayList<>(keys.size());
JanusGraphTransaction transaction = useJanusgraphTransaction ? graph.newTransaction() : null;
try {
for (String key : keys) {
String respon... | java |
public List<String> writeBulk(final List<String> keys) throws Exception {
List<String> responses = new ArrayList<>(keys.size());
for (String key : keys) {
String response = writeSingle(key);
responses.add(response);
}
return responses;
} | java |
public String getNDelimitedStrings(int n)
{
return IntStream.range(0, config.getColsPerRow()).mapToObj(i -> "'" + dataGenerator.getRandomValue() + "'").collect(Collectors.joining(","));
} | java |
protected void doBindView(View itemView, Context context, Cursor cursor) {
try {
@SuppressWarnings("unchecked")
ViewType itemViewType = (ViewType) itemView;
bindView(itemViewType, context, cursorToObject(cursor));
} catch (SQLException e) {
throw new RuntimeException(e);
}
} | java |
public T getTypedItem(int position) {
try {
return cursorToObject((Cursor) super.getItem(position));
} catch (SQLException e) {
throw new RuntimeException(e);
}
} | java |
protected T cursorToObject(Cursor cursor) throws SQLException {
return preparedQuery.mapRow(new AndroidDatabaseResults(cursor, null, true));
} | java |
public void changeCursor(Cursor cursor, PreparedQuery<T> preparedQuery) {
setPreparedQuery(preparedQuery);
super.changeCursor(cursor);
} | java |
static int execSql(SQLiteDatabase db, String label, String finalSql, Object[] argArray) throws SQLException {
try {
db.execSQL(finalSql, argArray);
} catch (android.database.SQLException e) {
throw SqlExceptionUtil.create("Problems executing " + label + " Android statement: " + finalSql, e);
}
int result;... | java |
public static void writeConfigFile(String fileName, boolean sortClasses) throws SQLException, IOException {
List<Class<?>> classList = new ArrayList<Class<?>>();
findAnnotatedClasses(classList, new File("."), 0);
writeConfigFile(fileName, classList.toArray(new Class[classList.size()]), sortClasses);
} | java |
public static void writeConfigFile(File configFile, boolean sortClasses) throws SQLException, IOException {
writeConfigFile(configFile, new File("."), sortClasses);
} | java |
protected static File findRawDir(File dir) {
for (int i = 0; dir != null && i < 20; i++) {
File rawDir = findResRawDir(dir);
if (rawDir != null) {
return rawDir;
}
dir = dir.getParentFile();
}
return null;
} | java |
private static String getPackageOfClass(File file) throws IOException {
BufferedReader reader = new BufferedReader(new FileReader(file));
try {
while (true) {
String line = reader.readLine();
if (line == null) {
return null;
}
if (line.contains("package")) {
String[] parts = line.split(... | java |
private static File findResRawDir(File dir) {
for (File file : dir.listFiles()) {
if (file.getName().equals(RESOURCE_DIR_NAME) && file.isDirectory()) {
File[] rawFiles = file.listFiles(new FileFilter() {
@Override
public boolean accept(File file) {
return file.getName().equals(RAW_DIR_NAME) && ... | java |
private static void innerSetHelperClass(Class<? extends OrmLiteSqliteOpenHelper> openHelperClass) {
// make sure if that there are not 2 helper classes in an application
if (openHelperClass == null) {
throw new IllegalStateException("Helper class was trying to be reset to null");
} else if (helperClass == null... | java |
private static OrmLiteSqliteOpenHelper constructHelper(Context context,
Class<? extends OrmLiteSqliteOpenHelper> openHelperClass) {
Constructor<?> constructor;
try {
constructor = openHelperClass.getConstructor(Context.class);
} catch (Exception e) {
throw new IllegalStateException(
"Could not find ... | java |
private static Class<? extends OrmLiteSqliteOpenHelper> lookupHelperClass(Context context, Class<?> componentClass) {
// see if we have the magic resource class name set
Resources resources = context.getResources();
int resourceId = resources.getIdentifier(HELPER_CLASS_RESOURCE_NAME, "string", context.getPackage... | java |
public static <T> DatabaseTableConfig<T> fromClass(ConnectionSource connectionSource, Class<T> clazz)
throws SQLException {
DatabaseType databaseType = connectionSource.getDatabaseType();
String tableName = DatabaseTableConfig.extractTableName(databaseType, clazz);
List<DatabaseFieldConfig> fieldConfigs = new ... | java |
private static int[] lookupClasses() {
Class<?> annotationMemberArrayClazz;
try {
annotationFactoryClazz = Class.forName("org.apache.harmony.lang.annotation.AnnotationFactory");
annotationMemberClazz = Class.forName("org.apache.harmony.lang.annotation.AnnotationMember");
annotationMemberArrayClazz = Class.... | java |
private static int configFieldNameToNum(String configName) {
if (configName.equals("columnName")) {
return COLUMN_NAME;
} else if (configName.equals("dataType")) {
return DATA_TYPE;
} else if (configName.equals("defaultValue")) {
return DEFAULT_VALUE;
} else if (configName.equals("width")) {
return ... | java |
private static DatabaseFieldConfig buildConfig(DatabaseField databaseField, String tableName, Field field)
throws Exception {
InvocationHandler proxy = Proxy.getInvocationHandler(databaseField);
if (proxy.getClass() != annotationFactoryClazz) {
return null;
}
// this should be an array of AnnotationMember... | java |
public H getHelper() {
if (helper == null) {
if (!created) {
throw new IllegalStateException("A call has not been made to onCreate() yet so the helper is null");
} else if (destroyed) {
throw new IllegalStateException(
"A call to onDestroy has already been made and the helper cannot be used after ... | java |
@Override
protected void onStartLoading() {
// XXX: do we really return the cached results _before_ checking if the content has changed?
if (cachedResults != null) {
deliverResult(cachedResults);
}
if (takeContentChanged() || cachedResults == null) {
forceLoad();
}
// watch for data changes
dao.reg... | java |
private ResponseEntity<String> executeRequest(final TelemetryEventData eventData) {
final HttpHeaders headers = new HttpHeaders();
headers.add(HttpHeaders.CONTENT_TYPE, APPLICATION_JSON.toString());
try {
final RestTemplate restTemplate = new RestTemplate();
final HttpE... | java |
@Override
public <S extends T> S save(S entity) {
Assert.notNull(entity, "entity must not be null");
// save entity
if (information.isNew(entity)) {
return operation.insert(information.getCollectionName(),
entity,
createKey(information.get... | java |
@Override
public <S extends T> Iterable<S> saveAll(Iterable<S> entities) {
Assert.notNull(entities, "Iterable entities should not be null");
entities.forEach(this::save);
return entities;
} | java |
@Override
public Iterable<T> findAll() {
return operation.findAll(information.getCollectionName(), information.getJavaType());
} | java |
@Override
public List<T> findAllById(Iterable<ID> ids) {
Assert.notNull(ids, "Iterable ids should not be null");
return operation.findByIds(ids, information.getJavaType(), information.getCollectionName());
} | java |
@Override
public Optional<T> findById(ID id) {
Assert.notNull(id, "id must not be null");
if (id instanceof String && !StringUtils.hasText((String) id)) {
return Optional.empty();
}
return Optional.ofNullable(operation.findById(information.getCollectionName(), id, infor... | java |
@Override
public void deleteById(ID id) {
Assert.notNull(id, "id to be deleted should not be null");
operation.deleteById(information.getCollectionName(), id, null);
} | java |
@Override
public void delete(T entity) {
Assert.notNull(entity, "entity to be deleted should not be null");
final String partitionKeyValue = information.getPartitionKeyFieldValue(entity);
operation.deleteById(information.getCollectionName(),
information.getId(entity),
... | java |
@Override
public void deleteAll(Iterable<? extends T> entities) {
Assert.notNull(entities, "Iterable entities should not be null");
StreamSupport.stream(entities.spliterator(), true).forEach(this::delete);
} | java |
@Override
public boolean existsById(ID primaryKey) {
Assert.notNull(primaryKey, "primaryKey should not be null");
return findById(primaryKey).isPresent();
} | java |
@Override
public Page<T> findAll(Pageable pageable) {
Assert.notNull(pageable, "pageable should not be null");
return operation.findAll(pageable, information.getJavaType(), information.getCollectionName());
} | java |
public static Object toDocumentDBValue(Object fromPropertyValue) {
if (fromPropertyValue == null) {
return null;
}
// com.microsoft.azure.documentdb.JsonSerializable#set(String, T) cannot set values for Date and Enum correctly
if (fromPropertyValue instanceof Date) {
... | java |
public void addProfile(Profile profile) {
if (PROFILE_KIND.equals(profile.getKind())) {
this.profileList.add(profile.getSettings());
}
} | java |
@Override
public void addRuleInstances(Digester digester) {
digester.addObjectCreate("profiles", Profiles.class);
digester.addObjectCreate(PROFILES_PROFILE, Profile.class);
digester.addObjectCreate(PROFILES_PROFILE_SETTING, Setting.class);
digester.addSetNext(PROFILES_PROFILE, "addP... | java |
List<File> addCollectionFiles(File newBasedir) {
final DirectoryScanner ds = new DirectoryScanner();
ds.setBasedir(newBasedir);
if (this.includes != null && this.includes.length > 0) {
ds.setIncludes(this.includes);
} else {
ds.setIncludes(DEFAULT_INCLUDES);
... | java |
private void storeFileHashCache(Properties props) {
File cacheFile = new File(this.targetDirectory, CACHE_PROPERTIES_FILENAME);
try (OutputStream out = new BufferedOutputStream(new FileOutputStream(cacheFile))) {
props.store(out, null);
} catch (IOException e) {
getLog().... | java |
private Properties readFileHashCacheFile() {
Properties props = new Properties();
Log log = getLog();
if (!this.targetDirectory.exists()) {
this.targetDirectory.mkdirs();
} else if (!this.targetDirectory.isDirectory()) {
log.warn("Something strange here as the '" ... | java |
private void formatFile(File file, ResultCollector rc, Properties hashCache, String basedirPath)
throws MojoFailureException, MojoExecutionException {
try {
doFormatFile(file, rc, hashCache, basedirPath, false);
} catch (IOException | MalformedTreeException | BadLocationException... | java |
private String readFileAsString(File file) throws java.io.IOException {
StringBuilder fileData = new StringBuilder(1000);
try (BufferedReader reader = new BufferedReader(ReaderFactory.newReader(file, this.encoding))) {
char[] buf = new char[1024];
int numRead = 0;
whi... | java |
private void writeStringToFile(String str, File file) throws IOException {
if (!file.exists() && file.isDirectory()) {
return;
}
try (BufferedWriter bw = new BufferedWriter(WriterFactory.newWriter(file, this.encoding))) {
bw.write(str);
}
} | java |
private JobParameters getNextJobParameters(Job job) throws JobParametersNotFoundException {
String jobIdentifier = job.getName();
JobParameters jobParameters;
List<JobInstance> lastInstances = jobExplorer.getJobInstances(jobIdentifier, 0, 1);
JobParametersIncrementer incrementer = job.getJobParametersIncrement... | java |
@Override
public String read() throws Exception {
String item = null;
if (index < input.length) {
item = input[index++];
LOGGER.info(item);
return item;
} else {
return null;
}
} | java |
String getShardKey(Message message) {
return getShardKey(message.getTokenTime(), this.modShardPolicy.getMessageShard(message, metadata));
} | java |
private String getShardKey(long messageTime, int modShard) {
long timePartition;
if (metadata.getPartitionDuration() != null)
timePartition = (messageTime / metadata.getPartitionDuration()) % metadata.getPartitionCount();
else
timePartition = 0;
return getName() +... | java |
@Override
public List<MessageHistory> getKeyHistory(String key, Long startTime, Long endTime, int count) throws MessageQueueException {
List<MessageHistory> list = Lists.newArrayList();
ColumnList<UUID> columns;
try {
columns = keyspace.prepareQuery(historyColumnFamily)
... | java |
@Override
public List<Message> peekMessages(int itemsToPeek) throws MessageQueueException {
List<Message> messages = Lists.newArrayList();
for (MessageQueueShard shard : shardReaderPolicy.listShards()) {
messages.addAll(peekMessages(shard.getName(), itemsToPeek - messages.size()));
... | java |
private Collection<Message> peekMessages(String shardName, int itemsToPeek) throws MessageQueueException {
try {
ColumnList<MessageQueueEntry> result = keyspace.prepareQuery(queueColumnFamily)
.setConsistencyLevel(consistencyLevel)
.getKey(shardName)
... | java |
Message extractMessageFromColumn(Column<MessageQueueEntry> column) {
// Next, parse the message metadata and add a timeout entry
Message message = null;
try {
ByteArrayInputStream bais = new ByteArrayInputStream(column.getByteArrayValue());
message = mapper.readValue(bais... | java |
private boolean hasMessages(String shardName) throws MessageQueueException {
UUID currentTime = TimeUUIDUtils.getUniqueTimeUUIDinMicros();
try {
ColumnList<MessageQueueEntry> result = keyspace.prepareQuery(queueColumnFamily)
.setConsistencyLevel(consistencyLevel)
... | java |
public void verifyLock(long curTimeInMicros) throws Exception, BusyLockException, StaleLockException {
if (lockColumn == null)
throw new IllegalStateException("verifyLock() called without attempting to take the lock");
// Read back all columns. There should be only 1 if we got the ... | java |
@Override
public void release() throws Exception {
if (!locksToDelete.isEmpty() || lockColumn != null) {
MutationBatch m = keyspace.prepareMutationBatch().setConsistencyLevel(consistencyLevel);
fillReleaseMutation(m, false);
m.execute();
}
} | java |
public Map<String, Long> releaseLocks(boolean force) throws Exception {
Map<String, Long> locksToDelete = readLockColumns();
MutationBatch m = keyspace.prepareMutationBatch().setConsistencyLevel(consistencyLevel);
ColumnListMutation<String> row = m.withRow(columnFamily, key);
long now =... | java |
private ByteBuffer generateTimeoutValue(long timeout) {
if (columnFamily.getDefaultValueSerializer() == ByteBufferSerializer.get() ||
columnFamily.getDefaultValueSerializer() == LongSerializer.get()) {
return LongSerializer.get().toByteBuffer(timeout);
}
else {
... | java |
public long readTimeoutValue(Column<?> column) {
if (columnFamily.getDefaultValueSerializer() == ByteBufferSerializer.get() ||
columnFamily.getDefaultValueSerializer() == LongSerializer.get()) {
return column.getLongValue();
}
else {
return Long.parseLong(colu... | java |
public List<ListenableFuture<OperationResult<Void>>> replayWal(int count) {
List<ListenableFuture<OperationResult<Void>>> futures = Lists.newArrayList();
WriteAheadEntry walEntry;
while (null != (walEntry = wal.readNextEntry()) && count-- > 0) {
MutationBatch m = keyspace.prepareMuta... | java |
public ListenableFuture<OperationResult<Void>> execute(final MutationBatch m) throws WalException {
final WriteAheadEntry walEntry = wal.createEntry();
walEntry.writeMutation(m);
return executeWalEntry(walEntry, m);
} | java |
public <V> V getColumnValue(T instance, String columnName,
Class<V> valueClass) {
Field field = fields.get(columnName);
if (field == null) {
throw new IllegalArgumentException("Column not found: "
+ columnName);
}
try {
return value... | java |
public <V> void setColumnValue(T instance, String columnName, V value) {
Field field = fields.get(columnName);
if (field == null) {
throw new IllegalArgumentException("Column not found: "
+ columnName);
}
try {
field.set(instance, value);
... | java |
public void fillMutation(T instance, ColumnListMutation<String> mutation) {
for (String fieldName : getNames()) {
Coercions.setColumnMutationFromField(instance, fields.get(fieldName), fieldName, mutation);
}
} | java |
public T newInstance(ColumnList<String> columns)
throws IllegalAccessException, InstantiationException {
return initInstance(clazz.newInstance(), columns);
} | java |
public T initInstance(T instance, ColumnList<String> columns) {
for (com.netflix.astyanax.model.Column<String> column : columns) {
Field field = fields.get(column.getName());
if (field != null) { // otherwise it may be a column that was
// removed, etc.
... | java |
public List<T> getAll(Rows<?, String> rows) throws InstantiationException,
IllegalAccessException {
List<T> list = Lists.newArrayList();
for (Row<?, String> row : rows) {
if (!row.getColumns().isEmpty()) {
list.add(newInstance(row.getColumns()));
}
... | java |
public BoundStatement getQueryStatement(CqlRowSliceQueryImpl<?,?> rowSliceQuery, boolean useCaching) {
switch (rowSliceQuery.getColQueryType()) {
case AllColumns:
return SelectAllColumnsForRowKeys.getBoundStatement(rowSliceQuery, useCaching);
case ColumnSet:
return SelectColumnSetForRowKeys.getBoundState... | java |
public synchronized boolean setPools(Collection<HostConnectionPool<CL>> newPools) {
Set<HostConnectionPool<CL>> toRemove = Sets.newHashSet(this.pools);
// Add new pools not previously seen
boolean didChange = false;
for (HostConnectionPool<CL> pool : newPools) {
if (... | java |
public synchronized boolean addPool(HostConnectionPool<CL> pool) {
if (this.pools.add(pool)) {
refresh();
return true;
}
return false;
} | java |
public synchronized void refresh() {
List<HostConnectionPool<CL>> pools = Lists.newArrayList();
for (HostConnectionPool<CL> pool : this.pools) {
if (!pool.isReconnecting()) {
pools.add(pool);
}
}
this.activePools.set(strategy.sortAndfilterPartition... | java |
public void fillReleaseMutation(MutationBatch m, boolean excludeCurrentLock) {
// Add the deletes to the end of the mutation
ColumnListMutation<C> row = m.withRow(columnFamily, key);
for (C c : locksToDelete) {
row.deleteColumn(c);
}
if (!excludeCurrentLock && lockCol... | java |
@Override
public void trackCheckpoint(String startToken, String checkpointToken) {
tokenMap.put(startToken, checkpointToken);
} | java |
public static <K> ColumnParent getColumnParent(ColumnFamily<?, ?> columnFamily, ColumnPath<?> path)
throws BadRequestException {
ColumnParent cp = new ColumnParent();
cp.setColumn_family(columnFamily.getName());
if (path != null) {
Iterator<ByteBuffer> columns = path.iter... | java |
public static <K> org.apache.cassandra.thrift.ColumnPath getColumnPath(ColumnFamily<?, ?> columnFamily,
ColumnPath<?> path) throws BadRequestException {
org.apache.cassandra.thrift.ColumnPath cp = new org.apache.cassandra.thrift.ColumnPath();
cp.setColumn_family(columnFamily.getName());
... | java |
public static <C> SlicePredicate getPredicate(ColumnSlice<C> columns, Serializer<C> colSer) {
// Get all the columns
if (columns == null) {
SlicePredicate predicate = new SlicePredicate();
predicate.setSlice_range(new SliceRange(ByteBuffer.wrap(new byte[0]), ByteBuffer.wrap(new b... | java |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.