本文整理匯總了Java中com.sleepycat.je.DatabaseException.printStackTrace方法的典型用法代碼示例。如果您正苦於以下問題:Java DatabaseException.printStackTrace方法的具體用法?Java DatabaseException.printStackTrace怎麽用?Java DatabaseException.printStackTrace使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.sleepycat.je.DatabaseException
的用法示例。
在下文中一共展示了DatabaseException.printStackTrace方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: asyncAddItemToSort
import com.sleepycat.je.DatabaseException; //導入方法依賴的package包/類
public void asyncAddItemToSort(byte tbyData[], int nTotalLength, int nNbRecordRead, boolean bVariableLength)
{
// if only 1 dedicated thread is used for adding an item to sort
m_data.setData(tbyData, 0, nTotalLength);
byte tbyKey[] = m_keyDescription.fillNewKeyBuffer(tbyData, nNbRecordRead, bVariableLength);
m_key.setData(tbyKey);
try
{
m_bdb.put(null, m_key, m_data);
//unlock
}
catch (DatabaseException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
// unlock
}
示例2: asyncAddItemToSortByMultiThreads
import com.sleepycat.je.DatabaseException; //導入方法依賴的package包/類
public void asyncAddItemToSortByMultiThreads(MultiThreadedSortAddItem multiThreadedSortItem, byte tbyData[])
{
// if more than 1 dedicated thread are used for adding an item to sort
DatabaseEntry data = new DatabaseEntry();
data.setData(tbyData, 0, multiThreadedSortItem.m_nTotalLength);
byte tbyKey[] = m_keyDescription.fillNewKeyBuffer(tbyData, multiThreadedSortItem.m_nNbRecordRead, multiThreadedSortItem.m_bVariableLength);
//Dumper.dump("Record read="+multiThreadedSortItem.m_nNbRecordRead);
//Dumper.dump(tbyKey);
DatabaseEntry key = new DatabaseEntry();
key.setData(tbyKey);
try
{
m_bdb.put(null, key, data);
}
catch (DatabaseException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
m_multiThreadedSortItemCache.disposeItemForReuse(multiThreadedSortItem);
}
示例3: syncGetFirst
import com.sleepycat.je.DatabaseException; //導入方法依賴的package包/類
public byte [] syncGetFirst()
{
try
{
m_cursor = m_bdb.openCursor(null, null);
OperationStatus status = m_cursor.getFirst(m_key, m_data, LockMode.DEFAULT);
if(status == OperationStatus.SUCCESS)
{
m_nNbRecordExported = 1;
byte tDataWithHeader[] = getDataRead();
return tDataWithHeader;
}
}
catch (DatabaseException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
return null;
}
示例4: syncGetNext
import com.sleepycat.je.DatabaseException; //導入方法依賴的package包/類
public byte [] syncGetNext()
{
try
{
if(m_cursor != null)
{
OperationStatus status = m_cursor.getNext(m_key, m_data, LockMode.DEFAULT);
if(status == OperationStatus.SUCCESS)
{
m_nNbRecordExported++;
byte tDataWithHeader[] = getDataRead();
return tDataWithHeader;
}
}
}
catch (DatabaseException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
return null;
}
示例5: getGroundhog
import com.sleepycat.je.DatabaseException; //導入方法依賴的package包/類
public Groundhog getGroundhog(String groundhogName){
Groundhog groundhog = null;
File file = new File(baseDirectoryPath + groundhogName);
if( file.isDirectory() ){
try {
groundhog = new Groundhog(file, defaultCacheSize);
return groundhog;
} catch (DatabaseException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
return groundhog;
}
示例6: setEntryInStore
import com.sleepycat.je.DatabaseException; //導入方法依賴的package包/類
@Override
protected void setEntryInStore(Integer id, ConceptVectorRecord value) {
try {
Transaction transaction = environment.beginTransaction(null, null);
DatabaseEntry theDBKey = new DatabaseEntry();
integerBinding.objectToEntry(id, theDBKey);
DatabaseEntry theDBValue = new DatabaseEntry();
recordDatabaseBinding.objectToEntry(value.getConceptVector(), theDBValue);
groundhog.put(transaction, theDBKey, theDBValue);
transaction.commit();
} catch (DatabaseException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
示例7: getEntryFromStoreWithID
import com.sleepycat.je.DatabaseException; //導入方法依賴的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;
}
示例8: getEntryFromStoreWithID
import com.sleepycat.je.DatabaseException; //導入方法依賴的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;
}
}
示例9: init
import com.sleepycat.je.DatabaseException; //導入方法依賴的package包/類
private void init(File datadir){
try {
environmentConfig = new EnvironmentConfig();
environmentConfig.setAllowCreate(true);
environmentConfig.setTransactional(true);
environmentConfig.setCacheSize(30240000);
environment = new Environment(datadir, environmentConfig);
databaseConfig = new DatabaseConfig();
databaseConfig.setAllowCreate(true);
databaseConfig.setTransactional(true);
openDB();
myIntegerBinding = TupleBinding.getPrimitiveBinding(Integer.class);
myDataBinding = new Integer2Integer2IntegerMapBinding();
sh = new CooccurrenceDatabaseShutdown();
sh.c = this;
Runtime.getRuntime().addShutdownHook(sh);
} catch (DatabaseException e) {
e.printStackTrace();
}
}
示例10: next
import com.sleepycat.je.DatabaseException; //導入方法依賴的package包/類
public void next() {
try {
if (myCursor.getNext(foundKey, foundData, LockMode.DEFAULT) == OperationStatus.SUCCESS) {
Integer key = (Integer) integerBinding.entryToObject(foundKey);
conceptVectorRecord = new ConceptVectorRecord(key);
conceptVectorRecord.setConceptVector((ConceptVector) recordDatabaseBinding.entryToObject(foundData));
}
else {
close();
conceptVectorRecord = null;
}
} catch (DatabaseException e) {
e.printStackTrace();
}
}
示例11: next
import com.sleepycat.je.DatabaseException; //導入方法依賴的package包/類
public ConceptVectorRecord next() {
ConceptVectorRecord result = null;
if (myCursor != null) {
if (toggle) {
result = next;
}
else {
try {
if (myCursor.getNext(foundKey, foundData, LockMode.DEFAULT) == OperationStatus.SUCCESS) {
Integer key = (Integer) integerBinding.entryToObject(foundKey);
result = new ConceptVectorRecord(key);
result.setConceptVector((ConceptVector) recordDatabaseBinding.entryToObject(foundData));
}
} catch (DatabaseException e) {
e.printStackTrace();
}
}
}
toggle = false;
return result;
}
示例12: next
import com.sleepycat.je.DatabaseException; //導入方法依賴的package包/類
public Integer2IntegerSet next() {
Integer2IntegerSet result = null;
if (myCursor != null) {
if (nextHasBeenRetrieved) {
result = next;
}
else {
try {
if (myCursor.getNext(foundKey, foundData, LockMode.DEFAULT) == OperationStatus.SUCCESS) {
Integer key = (Integer) myIntegerBinding.entryToObject(foundKey);
SortedIntListSet set = (SortedIntListSet) myDataBinding.entryToObject(foundData);
result = new Integer2IntegerSet(key, set);
}
} catch (DatabaseException e) {
e.printStackTrace();
}
}
}
nextHasBeenRetrieved = false;
return result;
}
示例13: readNext
import com.sleepycat.je.DatabaseException; //導入方法依賴的package包/類
private void readNext() {
if (myCursor != null) {
try {
if (myCursor.getNext(foundKey, foundData, LockMode.DEFAULT) == OperationStatus.SUCCESS) {
Integer key = (Integer) myIntegerBinding.entryToObject(foundKey);
next = (ConceptToConceptVectorRecordIndexEntry) myDataBinding.entryToObject(foundData);
next.key = key;
} else {
next = null;
myCursor.close();
}
} catch (DatabaseException e) {
e.printStackTrace();
}
}
}
示例14: internalSortInsertWithRecordIndexAtEnd
import com.sleepycat.je.DatabaseException; //導入方法依賴的package包/類
public boolean internalSortInsertWithRecordIndexAtEnd(byte tbyData[], int nSourceOffset, int nTotalLength, int nNbRecordRead, boolean bVariableLength)
{
if(m_nNbthreadsSort == 0) // No thread for sorting
{
byte tbyKey[] = m_keyDescription.fillKeyBuffer(tbyData, 0, nNbRecordRead, bVariableLength);
//LittleEndingUnsignBinaryBufferStorage.writeInt(tbyKey, nNbRecordRead, m_keyDescription.m_nKeyLength-4); // Intel format
m_data.setData(tbyData, 0, nTotalLength);
m_key.setData(tbyKey);
try
{
m_bdb.put(null, m_key, m_data);
return true;
}
catch (DatabaseException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
return false;
}
else // Multi threads for sorting
{
// Insert real record
MultiThreadedSortAddItem item = m_multiThreadedSortItemCache.getUsusedItem();
if(item == null)
item = new MultiThreadedSortAddItem(this, tbyData, nSourceOffset, nTotalLength, nNbRecordRead, bVariableLength);
else
item.fill(this, tbyData, nSourceOffset, nTotalLength, nNbRecordRead, bVariableLength);
m_threadsPoolWriter.enqueue(item);
return true;
}
}
示例15: externalSortInsertWithRecordIndexAtEnd
import com.sleepycat.je.DatabaseException; //導入方法依賴的package包/類
public boolean externalSortInsertWithRecordIndexAtEnd(Environment env, LineRead lineRead, int nNbRecordRead, boolean bFileInEbcdic, boolean bFileInVariableLength)
{
byte tbyData[] = lineRead.getBuffer();
int nOffset = lineRead.getOffset();
int nTotalLength = lineRead.getTotalLength();
if(m_nNbthreadsSort == 0) // No thread for sorting
{
byte tbyKey[] = m_keyDescription.fillKeyBufferExceptRecordId(lineRead, bFileInVariableLength); //, bFileInEbcdic);
LittleEndingUnsignBinaryBufferStorage.writeInt(tbyKey, nNbRecordRead, m_keyDescription.m_nKeyLength-4); // Write record id at the end of the key
m_data.setData(tbyData, nOffset, nTotalLength);
m_key.setData(tbyKey);
//Dumper.dump("Record read="+nNbRecordRead);
//Dumper.dump(tbyKey);
try
{
m_bdb.put(null, m_key, m_data);
return true;
}
catch (DatabaseException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
return false;
}
else
{
MultiThreadedSortAddItem item = m_multiThreadedSortItemCache.getUsusedItem();
if(item == null)
item = new MultiThreadedSortAddItem(this, tbyData, nOffset, nTotalLength, nNbRecordRead, bFileInVariableLength);
else
item.fill(this, tbyData, nOffset, nTotalLength, nNbRecordRead, bFileInVariableLength);
//MultiThreadedSortAddItem item = new MultiThreadedSortAddItem(this, tbyData, nOffset, nTotalLength, nNbRecordRead, bFileInVariableLength);
m_threadsPoolWriter.enqueue(item);
return true;
}
}