当前位置: 首页>>代码示例>>Java>>正文


Java Mutator.delete方法代码示例

本文整理汇总了Java中me.prettyprint.hector.api.mutation.Mutator.delete方法的典型用法代码示例。如果您正苦于以下问题:Java Mutator.delete方法的具体用法?Java Mutator.delete怎么用?Java Mutator.delete使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在me.prettyprint.hector.api.mutation.Mutator的用法示例。


在下文中一共展示了Mutator.delete方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: deleteColumns

import me.prettyprint.hector.api.mutation.Mutator; //导入方法依赖的package包/类
@Override
public void deleteColumns(K rowKey, N... columnNames) {
    if (columnNames.length == 0) {
        return;
    }

    Mutator<K> mutator = createMutator();
    if (columnNames.length == 1) {
        mutator.delete(rowKey, getColumnFamily(), columnNames[0], getColumnNameSerializer());
    } else {
        for (N columnName : columnNames) {
            mutator.addDeletion(rowKey, getColumnFamily(), columnName, getColumnNameSerializer());
        }
        mutator.execute();
    }
    // we used to translate hector exceptions into spring exceptions here, but spring dependency was removed
}
 
开发者ID:ezoerner,项目名称:c-star-path-j,代码行数:18,代码来源:ColumnFamilyTemplate.java

示例2: insert

import me.prettyprint.hector.api.mutation.Mutator; //导入方法依赖的package包/类
@Override
public <R, T> void insert(Keyspace keyspace, String columnFamily, DataOperationsProfile dataOperationsProfile, RowSerializer<R, T> rowSerializer, R rowKey, T topKey, Object value, int ttl) {
    Serializer<R> rowKeySerializer = rowSerializer.getRowKeySerializer();

    ByteBuffer serializedRowKey = rowKeySerializer.toByteBuffer(rowKey);
    if (serializedRowKey == null) {
        return;
    }

    Mutator<ByteBuffer> mutator = HFactory.createMutator(keyspace, ByteBufferSerializer.get());

    StopWatch monitor = monitoring.start(HerculesMonitoringGroup.HERCULES_DD, "Insert " + columnFamily);

    int serializedDataSize = 0;
    try {
        if (value == null) {
            mutator.delete(serializedRowKey, columnFamily, topKey, rowSerializer.getTopKeySerializer());
        } else {
            Serializer serializer = rowSerializer.hasValueSerializer(topKey) ? rowSerializer.getValueSerializer(topKey) : getSerializerForObject(value);
            ByteBuffer serializedValue = serializer.toByteBuffer(value);
            serializedDataSize += serializedValue.remaining();

            HColumn<T, ByteBuffer> column;
            if (ttl > 0) {
                column = HFactory.createColumn(topKey, serializedValue, ttl, rowSerializer.getTopKeySerializer(), ByteBufferSerializer.get());
            } else {
                column = HFactory.createColumn(topKey, serializedValue, rowSerializer.getTopKeySerializer(), ByteBufferSerializer.get());
            }
            mutator.insert(serializedRowKey, columnFamily, column);
        }
    } finally {
        long time = monitor.stop();
        if (dataOperationsProfile != null) {
            dataOperationsProfile.ms += time;
            dataOperationsProfile.bytes += serializedDataSize;
            dataOperationsProfile.dbQueries++;
        }
    }
}
 
开发者ID:appmetr,项目名称:hercules,代码行数:40,代码来源:ThriftDataDriver.java

示例3: deleteColumn

import me.prettyprint.hector.api.mutation.Mutator; //导入方法依赖的package包/类
public static<K> void deleteColumn(Mutator<K> mutator, K key, String columnFamily, ByteBuffer columnName){
  mutator.delete(key, columnFamily, columnName, ByteBufferSerializer.get());
}
 
开发者ID:jianglibo,项目名称:gora-boot,代码行数:4,代码来源:HectorUtils.java

示例4: removeHeader

import me.prettyprint.hector.api.mutation.Mutator; //导入方法依赖的package包/类
public String removeHeader(String key) {

		Mutator<byte[]> mutator = createMutator(keyspace, bytesSerializer);			

		mutator.delete(key.getBytes(), HEADER, INFO, stringSerializer);
		// perform the insert
		mutator.execute();	
		
		return "{\"result_code\":200}\n";		
	}
 
开发者ID:oneops,项目名称:oneops,代码行数:11,代码来源:PerfHeaderDao.java

示例5: deleteSingleColumnData

import me.prettyprint.hector.api.mutation.Mutator; //导入方法依赖的package包/类
private void deleteSingleColumnData() {

        Mutator<String> mutator = HFactory.createMutator(keyspace, stringSerializer);
        mutator.delete("jsmith", COLUMN_FAMILY_NAME_1, "first", stringSerializer);

        mutator.addDeletion("jsmith", COLUMN_FAMILY_NAME_1, "middle", stringSerializer)
                .addDeletion("jsmith", COLUMN_FAMILY_NAME_1, "last", stringSerializer).execute();

    }
 
开发者ID:xuzhikethinker,项目名称:t4f-data,代码行数:10,代码来源:HectorCassandraTest.java


注:本文中的me.prettyprint.hector.api.mutation.Mutator.delete方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。