本文整理汇总了Java中com.sleepycat.je.DatabaseEntry.getSize方法的典型用法代码示例。如果您正苦于以下问题:Java DatabaseEntry.getSize方法的具体用法?Java DatabaseEntry.getSize怎么用?Java DatabaseEntry.getSize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.sleepycat.je.DatabaseEntry
的用法示例。
在下文中一共展示了DatabaseEntry.getSize方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getEntryFromStoreWithID
import com.sleepycat.je.DatabaseEntry; //导入方法依赖的package包/类
@Override
public ConceptVectorRecord getEntryFromStoreWithID(Integer id) {
ConceptVectorRecord record = new ConceptVectorRecord(id);
DatabaseEntry theKey = new DatabaseEntry();
integerBinding.objectToEntry(record.getID(), theKey);
DatabaseEntry theValue = new DatabaseEntry();
try {
groundhog.get(null, theKey, theValue, LockMode.DEFAULT);
} catch (DatabaseException e) {
e.printStackTrace();
}
if (theValue.getSize() != 0) {
record.setConceptVector((ConceptVector) recordDatabaseBinding.entryToObject(theValue));
return record;
}
else {
return null;
}
}
示例2: getEntryFromStoreWithID
import com.sleepycat.je.DatabaseEntry; //导入方法依赖的package包/类
@Override
protected ConceptToConceptVectorRecordIndexEntry getEntryFromStoreWithID(Integer id) {
ConceptToConceptVectorRecordIndexEntry conceptToRecordIndexEntry = null;
try {
DatabaseEntry databaseKey = new DatabaseEntry();
DatabaseEntry databaseValue = new DatabaseEntry();
myIntegerBinding.objectToEntry(id, databaseKey);
conceptToConceptVectorIndexStore.get(null, databaseKey, databaseValue, LockMode.DEFAULT);
if (databaseValue.getSize() != 0) {
conceptToRecordIndexEntry = (ConceptToConceptVectorRecordIndexEntry) myDataBinding.entryToObject(databaseValue);
}
} catch (DatabaseException e) {
e.printStackTrace();
}
return conceptToRecordIndexEntry;
}
示例3: getEntryFromStoreWithID
import com.sleepycat.je.DatabaseEntry; //导入方法依赖的package包/类
@Override
protected SortedIntListSet getEntryFromStoreWithID(Integer id) {
SortedIntListSet result = null;
try {
DatabaseEntry databaseKey = new DatabaseEntry();
DatabaseEntry databaseValue = new DatabaseEntry();
myIntegerBinding.objectToEntry(id, databaseKey);
integerToSetOfIntegersStore.get(null, databaseKey, databaseValue, LockMode.DEFAULT);
if (databaseValue.getSize() != 0) {
result = (SortedIntListSet) myDataBinding.entryToObject(databaseValue);
}
} catch (DatabaseException e) {
e.printStackTrace();
}
return result;
}
示例4: getEntryFromStoreWithID
import com.sleepycat.je.DatabaseEntry; //导入方法依赖的package包/类
@Override
protected SortedIntList2IntMap getEntryFromStoreWithID(Integer id) {
SortedIntList2IntMap result = null;
try {
DatabaseEntry databaseKey = new DatabaseEntry();
DatabaseEntry databaseValue = new DatabaseEntry();
myIntegerBinding.objectToEntry(id, databaseKey);
cooccurrenceDB.get(null, databaseKey, databaseValue, LockMode.DEFAULT);
if (databaseValue.getSize() != 0) {
result = (SortedIntList2IntMap) myDataBinding.entryToObject(databaseValue);
}
} catch (DatabaseException e) {
e.printStackTrace();
}
return result;
}
示例5: getEntryFromStoreWithID
import com.sleepycat.je.DatabaseEntry; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
@Override
protected V getEntryFromStoreWithID(K id) {
DatabaseEntry theKey = new DatabaseEntry();
keyBinding.objectToEntry(id, theKey);
DatabaseEntry theValue = new DatabaseEntry();
try {
database.get(null, theKey, theValue, LockMode.DEFAULT);
} catch (DatabaseException e) {
e.printStackTrace();
}
if (theValue.getSize() != 0)
return (V) valueBinding.entryToObject(theValue);
else
return notInDatabase;
}
示例6: get
import com.sleepycat.je.DatabaseEntry; //导入方法依赖的package包/类
@Override
public CloneableRecord get(ExecutionContext context, CloneableRecord key, IndexMeta indexMeta, String dbName) {
DatabaseEntry keyEntry = new DatabaseEntry();
DatabaseEntry valueEntry = new DatabaseEntry();
keyEntry.setData(indexCodecMap.get(indexMeta.getName()).getKey_codec().encode(key));
OperationStatus status = getDatabase(dbName).get(context.getTransaction() == null ? null : ((JE_Transaction) context.getTransaction()).txn,
keyEntry,
valueEntry,
LockMode.DEFAULT);
if (OperationStatus.SUCCESS != status) {
return null;
}
if (valueEntry.getSize() != 0) {
return indexCodecMap.get(indexMeta.getName()).getValue_codec().decode(valueEntry.getData());
} else {
return null;
}
}
示例7: entryToObject
import com.sleepycat.je.DatabaseEntry; //导入方法依赖的package包/类
private Object entryToObject(DatabaseEntry entry) throws Exception {
int len = entry.getSize();
if (len == 0) {
return null;
} else {
// return KryoSerializer.read(entry.getData()); // #+# outcommented: What's KryoSerializer?
return kryoserializer.deserialize(entry.getData(), DatabaseEntry.class); // #+# ADDED
}
}