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


Java StorageProxy.mutate方法代码示例

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


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

示例1: mutate

import org.apache.cassandra.service.StorageProxy; //导入方法依赖的package包/类
private void mutate(List<org.apache.cassandra.db.Mutation> cmds, org.apache.cassandra.db.ConsistencyLevel clvl) throws BackendException {
    try {
        schedule(DatabaseDescriptor.getRpcTimeout());
        try {
            if (atomicBatch) {
                StorageProxy.mutateAtomically(cmds, clvl);
            } else {
                StorageProxy.mutate(cmds, clvl);
            }
        } catch (RequestExecutionException e) {
            throw new TemporaryBackendException(e);
        } finally {
            release();
        }
    } catch (TimeoutException ex) {
        log.debug("Cassandra TimeoutException", ex);
        throw new TemporaryBackendException(ex);
    }
}
 
开发者ID:graben1437,项目名称:titan1withtp3.1,代码行数:20,代码来源:CassandraEmbeddedStoreManager.java

示例2: mutate

import org.apache.cassandra.service.StorageProxy; //导入方法依赖的package包/类
private void mutate(List<RowMutation> cmds, org.apache.cassandra.db.ConsistencyLevel clvl) throws BackendException {
    try {
        schedule(DatabaseDescriptor.getRpcTimeout());
        try {
            if (atomicBatch) {
                StorageProxy.mutateAtomically(cmds, clvl);
            } else {
                StorageProxy.mutate(cmds, clvl);
            }
        } catch (RequestExecutionException e) {
            throw new TemporaryBackendException(e);
        } finally {
            release();
        }
    } catch (TimeoutException ex) {
        log.debug("Cassandra TimeoutException", ex);
        throw new TemporaryBackendException(ex);
    }
}
 
开发者ID:graben1437,项目名称:titan0.5.4-hbase1.1.1-custom,代码行数:20,代码来源:CassandraEmbeddedStoreManager.java

示例3: doInsert

import org.apache.cassandra.service.StorageProxy; //导入方法依赖的package包/类
private void doInsert(ConsistencyLevel consistency_level, List<? extends IMutation> mutations, boolean mutateAtomically)
    throws UnavailableException, TimedOutException, org.apache.cassandra.exceptions.InvalidRequestException
    {
        org.apache.cassandra.db.ConsistencyLevel consistencyLevel = ThriftConversion.fromThrift(consistency_level);
//wso2        
		consistencyLevel.validateForWrite(state().getResolvedKeyspace());
        if (mutations.isEmpty())
            return;

        schedule(DatabaseDescriptor.getWriteRpcTimeout());
        try
        {
            if (mutateAtomically)
                StorageProxy.mutateAtomically((List<RowMutation>) mutations, consistencyLevel);
            else
                StorageProxy.mutate(mutations, consistencyLevel);
        }
        catch (RequestExecutionException e)
        {
            ThriftConversion.rethrow(e);
        }
        finally
        {
            release();
        }
    }
 
开发者ID:wso2,项目名称:wso2-cassandra,代码行数:27,代码来源:CassandraServer.java

示例4: doInsert

import org.apache.cassandra.service.StorageProxy; //导入方法依赖的package包/类
private void doInsert(ConsistencyLevel consistency_level, List<? extends IMutation> mutations, boolean mutateAtomically)
throws UnavailableException, TimedOutException, org.apache.cassandra.exceptions.InvalidRequestException
{
    org.apache.cassandra.db.ConsistencyLevel consistencyLevel = ThriftConversion.fromThrift(consistency_level);
    consistencyLevel.validateForWrite(state().getKeyspace());
    if (mutations.isEmpty())
        return;

    schedule(DatabaseDescriptor.getWriteRpcTimeout());
    try
    {
        if (mutateAtomically)
            StorageProxy.mutateAtomically((List<RowMutation>) mutations, consistencyLevel);
        else
            StorageProxy.mutate(mutations, consistencyLevel);
    }
    catch (RequestExecutionException e)
    {
        ThriftConversion.rethrow(e);
    }
    finally
    {
        release();
    }
}
 
开发者ID:jackliu8722,项目名称:cassandra-1.2.16,代码行数:26,代码来源:CassandraServer.java

示例5: testWriting

import org.apache.cassandra.service.StorageProxy; //导入方法依赖的package包/类
private static void testWriting() throws Exception
{
    // do some writing.
    for (int i = 0; i < 100; i++)
    {
        RowMutation change = new RowMutation(KEYSPACE, ByteBufferUtil.bytes(("key" + i)));
        ColumnPath cp = new ColumnPath(COLUMN_FAMILY).setColumn(("colb").getBytes());
        change.add(new QueryPath(cp), ByteBufferUtil.bytes(("value" + i)), 0);

        // don't call change.apply().  The reason is that is makes a static call into Table, which will perform
        // local storage initialization, which creates local directories.
        // change.apply();

        StorageProxy.mutate(Arrays.asList(change), ConsistencyLevel.ONE);
        System.out.println("wrote key" + i);
    }
    System.out.println("Done writing.");
}
 
开发者ID:devdattakulkarni,项目名称:Cassandra-KVPM,代码行数:19,代码来源:ClientOnlyExample.java

示例6: doInsert

import org.apache.cassandra.service.StorageProxy; //导入方法依赖的package包/类
private void doInsert(ConsistencyLevel consistency_level,
		List<? extends IMutation> mutations) throws UnavailableException,
		TimedOutException, InvalidRequestException {
	ThriftValidation.validateConsistencyLevel(state().getKeyspace(),
			consistency_level);
	try {
		schedule();

		try {
			if (!mutations.isEmpty())
				StorageProxy.mutate(mutations, consistency_level);
		} catch (TimeoutException e) {
			throw new TimedOutException();
		}
	} finally {
		release();
	}
}
 
开发者ID:devdattakulkarni,项目名称:Cassandra-KVPM,代码行数:19,代码来源:CassandraServer.java

示例7: mutateWithCatch

import org.apache.cassandra.service.StorageProxy; //导入方法依赖的package包/类
static void mutateWithCatch(Mutation mutation)
{
    try
    {
        StorageProxy.mutate(Collections.singletonList(mutation), ConsistencyLevel.ANY);
    }
    catch (OverloadedException e)
    {
        Tracing.logger.warn("Too many nodes are overloaded to save trace events");
    }
}
 
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:12,代码来源:TraceState.java


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