コード例 #1
0
ファイル: RemoteCacheImpl.cpp プロジェクト: alanfx/cpp-client
void RemoteCacheImpl::containsKey(const void* k, bool* r) {
    ScopedBuffer kbuf;
    remoteCacheBase.baseKeyMarshall(k, &kbuf);
    hrbytes keyBytes(kbuf.getBytes(), kbuf.getLength());
    hr_scoped_ptr<ContainsKeyOperation> gco(
        operationsFactory->newContainsKeyOperation(keyBytes));
    *r = gco->execute();
}
コード例 #2
0
ファイル: RemoteCacheImpl.cpp プロジェクト: alanfx/cpp-client
void RemoteCacheImpl::removeWithVersion(const void* k, uint64_t version, bool* res) {
    ScopedBuffer kbuf;
    remoteCacheBase.baseKeyMarshall(k, &kbuf);
    hrbytes keyBytes(kbuf.getBytes(), kbuf.getLength());

    hr_scoped_ptr<RemoveIfUnmodifiedOperation> gco(operationsFactory->newRemoveIfUnmodifiedOperation(keyBytes, version));
    VersionedOperationResponse response = gco->execute();
    *res = response.isUpdated();
}
コード例 #3
0
ファイル: RemoteCacheImpl.cpp プロジェクト: alanfx/cpp-client
void RemoteCacheImpl::remove(const void* k, void* b) {
    ScopedBuffer kbuf;
    ScopedBuffer& vbuf(*(ScopedBuffer *)b);
    remoteCacheBase.baseKeyMarshall(k, &kbuf);
    hrbytes keyBytes(kbuf.getBytes(), kbuf.getLength());

    hr_scoped_ptr<RemoveOperation> gco(operationsFactory->newRemoveOperation(keyBytes));
    hrbytes bytes = gco->execute();
    bytes.releaseTo(vbuf);
}
コード例 #4
0
void RemoteCacheImpl::get(RemoteCacheBase& remoteCacheBase, const void *k, void* b) {
    assertRemoteCacheManagerIsStarted();
	ScopedBuffer kbuf;
    ScopedBuffer& vbuf(*(ScopedBuffer *)b);
    remoteCacheBase.baseKeyMarshall(k, &kbuf);
    hrbytes keyBytes(kbuf.getBytes(), kbuf.getLength());

    hr_scoped_ptr<GetOperation> gco(operationsFactory->newGetKeyOperation(keyBytes));
    hrbytes bytes = gco->execute();
    bytes.releaseTo(vbuf);
}
コード例 #5
0
void RemoteCacheImpl::getWithVersion(RemoteCacheBase& remoteCacheBase, const void *k, void* b, VersionedValue* version)
{
    assertRemoteCacheManagerIsStarted();
    ScopedBuffer kbuf;
    ScopedBuffer& vbuf(*(ScopedBuffer *)b);
    remoteCacheBase.baseKeyMarshall(k, &kbuf);
    hrbytes keyBytes(kbuf.getBytes(), kbuf.getLength());
    hr_scoped_ptr<GetWithVersionOperation> gco(operationsFactory->newGetWithVersionOperation(keyBytes));
    VersionedValueImpl<hrbytes> m = gco->execute();
    m.getValue().releaseTo(vbuf);
    version->version = m.version;
}
コード例 #6
0
ファイル: RemoteCacheImpl.cpp プロジェクト: alanfx/cpp-client
void RemoteCacheImpl::getWithMetadata(
		const void *k, void* b, MetadataValue* metadata)
{
    ScopedBuffer kbuf;
    ScopedBuffer& vbuf(*(ScopedBuffer *)b);
    remoteCacheBase.baseKeyMarshall(k, &kbuf);
    hrbytes keyBytes(kbuf.getBytes(), kbuf.getLength());
    hr_scoped_ptr<GetWithMetadataOperation> gco(operationsFactory->newGetWithMetadataOperation(keyBytes));
    MetadataValueImpl<hrbytes> m = gco->execute();
    m.getValue().releaseTo(vbuf);
    metadata->version = m.version;
    metadata->created = m.created;
    metadata->lifespan = m.lifespan;
    metadata->lastUsed = m.lastUsed;
    metadata->maxIdle = m.maxIdle;
}