• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java DatabaseNotFoundException类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.sleepycat.je.DatabaseNotFoundException的典型用法代码示例。如果您正苦于以下问题:Java DatabaseNotFoundException类的具体用法?Java DatabaseNotFoundException怎么用?Java DatabaseNotFoundException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



DatabaseNotFoundException类属于com.sleepycat.je包,在下文中一共展示了DatabaseNotFoundException类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: renameReplicaDb

import com.sleepycat.je.DatabaseNotFoundException; //导入依赖的package包/类
/**
 * Replica invocations.
 *
 * @see #doRenameDb
 */
public DatabaseImpl renameReplicaDb(Locker locker,
                                    String databaseName,
                                    String newName,
                                    NameLN replicatedLN,
                                    DbOpReplicationContext repContext)
    throws DatabaseNotFoundException {

    try {
        return doRenameDb(locker, databaseName, newName, replicatedLN,
                          repContext);
    } catch (NeedRepLockerException e) {
        /* Should never happen; db is known when locker is created. */
        throw EnvironmentFailureException.unexpectedException(envImpl, e);
    }
}
 
开发者ID:prat0318,项目名称:dbms,代码行数:21,代码来源:DbTree.java


示例2: truncateReplicaDb

import com.sleepycat.je.DatabaseNotFoundException; //导入依赖的package包/类
/**
 * @see #doTruncateDb
 */
public TruncateDbResult truncateReplicaDb(Locker locker,
                                          String databaseName,
                                          boolean returnCount,
                                          NameLN replicatedLN,
                                          DbOpReplicationContext repContext)
    throws DatabaseNotFoundException {

    try {
        return doTruncateDb(locker, databaseName, returnCount,
                            replicatedLN, repContext);
    } catch (NeedRepLockerException e) {
        /* Should never happen; db is known when locker is created. */
        throw EnvironmentFailureException.unexpectedException(envImpl, e);
    }
}
 
开发者ID:prat0318,项目名称:dbms,代码行数:19,代码来源:DbTree.java


示例3: dbRename

import com.sleepycat.je.DatabaseNotFoundException; //导入依赖的package包/类
/**
 * Stand alone and Master invocations.
 *
 * @see #doRenameDb
 */
public DatabaseImpl dbRename(Locker locker,
                             String databaseName,
                             String newName)
    throws DatabaseNotFoundException, NeedRepLockerException {

    return doRenameDb(locker, databaseName, newName, null, null);
}
 
开发者ID:prat0318,项目名称:dbms,代码行数:13,代码来源:DbTree.java


示例4: dbRemove

import com.sleepycat.je.DatabaseNotFoundException; //导入依赖的package包/类
/**
 * Stand alone and Master invocations.
 *
 * @see #doRemoveDb
 */
public DatabaseImpl dbRemove(Locker locker,
                     String databaseName,
                     DatabaseId checkId)
    throws DatabaseNotFoundException, NeedRepLockerException {

    return doRemoveDb(locker, databaseName, checkId, null);
}
 
开发者ID:prat0318,项目名称:dbms,代码行数:13,代码来源:DbTree.java


示例5: removeReplicaDb

import com.sleepycat.je.DatabaseNotFoundException; //导入依赖的package包/类
/**
 * Replica invocations.
 *
 * @see #doRemoveDb
 */
public void removeReplicaDb(Locker locker,
                            String databaseName,
                            DatabaseId checkId,
                            DbOpReplicationContext repContext)
    throws DatabaseNotFoundException {

    try {
        doRemoveDb(locker, databaseName, checkId, repContext);
    } catch (NeedRepLockerException e) {
        /* Should never happen; db is known when locker is created. */
        throw EnvironmentFailureException.unexpectedException(envImpl, e);
    }
}
 
开发者ID:prat0318,项目名称:dbms,代码行数:19,代码来源:DbTree.java


示例6: truncate

import com.sleepycat.je.DatabaseNotFoundException; //导入依赖的package包/类
/**
 * @see #doTruncateDb
 */
public TruncateDbResult truncate(Locker locker,
                                 String databaseName,
                                 boolean returnCount)
    throws DatabaseNotFoundException, NeedRepLockerException {

    return doTruncateDb(locker, databaseName, returnCount, null, null);
}
 
开发者ID:prat0318,项目名称:dbms,代码行数:11,代码来源:DbTree.java


示例7: getDatabaseStats

import com.sleepycat.je.DatabaseNotFoundException; //导入依赖的package包/类
/**
 * Helper to get statistics for a given database.
 * @param params operation parameters
 * @return DatabaseStats object
 */
private DatabaseStats getDatabaseStats(Environment targetEnv,
                                       Object[] params)
    throws IllegalArgumentException,
           DatabaseNotFoundException,
           DatabaseException {

    if ((params == null) || (params.length < 3)) {
        return null;
    }
    String dbName = (String)params[2];

    Database db = null;
    try {
        DatabaseConfig dbConfig = new DatabaseConfig();
        dbConfig.setReadOnly(true);
        DbInternal.setUseExistingConfig(dbConfig, true);
        try {
            db = targetEnv.openDatabase(null, dbName, dbConfig);
        } catch (DatabaseExistsException e) {
            /* Should never happen, ExlcusiveCreate is false. */
            throw EnvironmentFailureException.unexpectedException(e);
        }
        return db.getStats(getStatsConfig(params));
    } finally {
        if (db != null) {
            db.close();
        }
    }
}
 
开发者ID:prat0318,项目名称:dbms,代码行数:35,代码来源:JEMBeanHelper.java


示例8: getGroup

import com.sleepycat.je.DatabaseNotFoundException; //导入依赖的package包/类
/**
 * Returns all the members that are currently part of the replication
 * group. This method can read the database directly, and can be used when
 * the replicated environment is detached and the RepNode is null. It's for
 * the latter reason that the method reads uncommitted data. In detached
 * mode, there may be transactions on the database that were in progress
 * when the node was last shutdown. These transactions may have locks which
 * will not be released until after the node is re-attached and the
 * replication stream is resumed. Using uncommitted reads avoids use of
 * locks in this circumstance. It's safe to read these records, since the
 * database will eventually be updated with these changes.
 *
 * @param policy determines how current the information must be if it's
 * invoked on a Replica.
 *
 * @return the group object
 * @throws DatabaseException if the object could not be obtained
 */
public static RepGroupImpl getGroup(RepImpl rImpl,
                                    String groupName,
                                    ReplicaConsistencyPolicy policy)
    throws DatabaseException {

    DatabaseImpl dbImpl = null;
    try {
        dbImpl = rImpl.getGroupDb(policy);
    } catch (DatabaseNotFoundException e) {
        /* Creates a temporary placeholder group for use until the real
         * definition comes over the replication stream as part of the
         * replicated group database.
         */
        return new RepGroupImpl(groupName, true);
    }

    TransactionConfig txnConfig = new TransactionConfig();
    txnConfig.setDurability(READ_ONLY.getDurability());
    txnConfig.setConsistencyPolicy(policy);
    txnConfig.setReadUncommitted(true);

    Txn txn = null;
    try {
        txn = new ReadonlyTxn(rImpl, txnConfig);
        RepGroupImpl group = fetchGroup(groupName, dbImpl, txn);
        /* Correct summary info since we are reading uncommitted data */
        group.makeConsistent();
        txn.commit();
        txn = null;

        return group;
    } finally {
        if (txn != null) {
            txn.abort();
        }
    }
}
 
开发者ID:prat0318,项目名称:dbms,代码行数:56,代码来源:RepGroupDB.java


示例9: TwoPhaseUpdate

import com.sleepycat.je.DatabaseNotFoundException; //导入依赖的package包/类
private TwoPhaseUpdate(RepNodeImpl node) {
    super();
    this.node = node;
    try {
        groupDbImpl = repImpl.getGroupDb();
    } catch (DatabaseNotFoundException e) {
        /* Should never happen. */
        throw EnvironmentFailureException.unexpectedException(e);
    }
}
 
开发者ID:prat0318,项目名称:dbms,代码行数:11,代码来源:RepGroupDB.java


示例10: probeGroupDb

import com.sleepycat.je.DatabaseNotFoundException; //导入依赖的package包/类
/**
 * Open the group db, which should exist already. Do not wait on the
 * group db lock, return null if the databaseImpl hasn't been created and
 * we can't obtain it.
 *
 * Lock hierarchy: GroupDbLock -> sync on EnvironmentImpl
 */
public DatabaseImpl probeGroupDb()
    throws DatabaseException {

    try {
        return openGroupDb(NO_CONSISTENCY, true /* doLockProbe */);
    } catch (DatabaseNotFoundException e) {
        /* Should never happen, DB should exist. */
        throw EnvironmentFailureException.unexpectedException(e);
    }
}
 
开发者ID:prat0318,项目名称:dbms,代码行数:18,代码来源:RepImpl.java


示例11: initInternalStructure

import com.sleepycat.je.DatabaseNotFoundException; //导入依赖的package包/类
public void initInternalStructure(DatabaseSession databaseSession) throws BimserverLockConflictException, BimserverDatabaseException {
	RecordIterator recordIterator = keyValueStore.getRecordIterator(CLASS_LOOKUP_TABLE, databaseSession);
	try {
		Record record = recordIterator.next();
		while (record != null) {
			String packageAndClassName = BinUtils.byteArrayToString(record.getValue());
			String packageName = packageAndClassName.substring(0, packageAndClassName.indexOf("_"));
			String className = packageAndClassName.substring(packageAndClassName.indexOf("_") + 1);
			EClass eClass = (EClass) getEClassifier(packageName, className);
			
			// TODO geometry?
			boolean transactional = !(eClass.getEPackage() == Ifc2x3tc1Package.eINSTANCE || eClass.getEPackage() == Ifc4Package.eINSTANCE);

			keyValueStore.openTable(databaseSession, packageAndClassName, transactional);
			
			for (EStructuralFeature eStructuralFeature : eClass.getEAllStructuralFeatures()) {
				if (eStructuralFeature.getEAnnotation("singleindex") != null) {
					String indexTableName = eClass.getEPackage().getName() + "_" + eClass.getName() + "_" + eStructuralFeature.getName();
					try {
						keyValueStore.openIndexTable(databaseSession, indexTableName, transactional);
					} catch (DatabaseNotFoundException e) {
					}
				}
			}
			
			Short cid = BinUtils.byteArrayToShort(record.getKey());
			cidToEclass[cid] = eClass;
			eClassToCid.put(eClass, cid);
			record = recordIterator.next();
		}
	} finally {
		recordIterator.close();
	}
}
 
开发者ID:opensourceBIM,项目名称:BIMserver,代码行数:35,代码来源:Database.java


示例12: exists

import com.sleepycat.je.DatabaseNotFoundException; //导入依赖的package包/类
/**
 * true if there is a persistent database underlying this, otherwise false
 * 
 * @return true if there is a persistent database underlying this, otherwise false
 */
public boolean exists() {
	try {
		getDatabase(true) ;
	} catch(DatabaseNotFoundException e) {
		return false ;
	}
	return true ;
}
 
开发者ID:busk,项目名称:WikipediaMiner,代码行数:14,代码来源:WDatabase.java


示例13: getDatabase

import com.sleepycat.je.DatabaseNotFoundException; //导入依赖的package包/类
protected Database getDatabase(boolean readOnly) throws DatabaseException {
	
	DatabaseConfig conf = new DatabaseConfig() ;
	
	conf.setReadOnly(readOnly) ;
	conf.setAllowCreate(!readOnly) ;
	conf.setExclusiveCreate(!readOnly) ;

	if (database != null) {
		if (database.getConfig().getReadOnly() == readOnly) {
			//the database is already open as it should be.
			return database ;
		} else {
			//the database needs to be closed and re-opened.
			database.close();
		}
	}
	
	if (!readOnly) {
		try {
			env.getEnvironment().removeDatabase(null, name) ;
		} catch (DatabaseNotFoundException e) {} ;
	}
	
	database = env.getEnvironment().openDatabase(null, name, conf);
	return database ;
}
 
开发者ID:busk,项目名称:WikipediaMiner,代码行数:28,代码来源:WDatabase.java


示例14: openDatabase

import com.sleepycat.je.DatabaseNotFoundException; //导入依赖的package包/类
/**
 * @see Environment#openDatabase(Transaction, String, DatabaseConfig)
 */
public synchronized Database openDatabase(Transaction txn, String databaseName, DatabaseConfig dbConfig)
        throws DatabaseNotFoundException, DatabaseExistsException, IllegalArgumentException, IllegalStateException {
    return delegate().openDatabase(txn, databaseName, dbConfig);
}
 
开发者ID:jronrun,项目名称:benayn,代码行数:8,代码来源:Berkeley.java


示例15: openSecondaryDatabase

import com.sleepycat.je.DatabaseNotFoundException; //导入依赖的package包/类
/**
 * @see Environment#openSecondaryDatabase(Transaction, String, Database, SecondaryConfig)
 */
public synchronized SecondaryDatabase openSecondaryDatabase(Transaction txn, String databaseName, 
        Database primaryDatabase, SecondaryConfig dbConfig) throws DatabaseNotFoundException, DatabaseExistsException,
        DatabaseException, IllegalArgumentException, IllegalStateException {
    return delegate().openSecondaryDatabase(txn, databaseName, primaryDatabase, dbConfig);
}
 
开发者ID:jronrun,项目名称:benayn,代码行数:9,代码来源:Berkeley.java


示例16: removeDatabase

import com.sleepycat.je.DatabaseNotFoundException; //导入依赖的package包/类
/**
 * @see Environment#removeDatabase(Transaction, String)
 */
public void removeDatabase(final Transaction txn, final String databaseName) throws DatabaseNotFoundException {
    delegate().removeDatabase(txn, databaseName);
}
 
开发者ID:jronrun,项目名称:benayn,代码行数:7,代码来源:Berkeley.java


示例17: renameDatabase

import com.sleepycat.je.DatabaseNotFoundException; //导入依赖的package包/类
/**
 * @see Environment#renameDatabase(Transaction, String, String)
 */
public void renameDatabase(final Transaction txn, 
        final String databaseName, final String newName) throws DatabaseNotFoundException {
    delegate().renameDatabase(txn, databaseName, newName);
}
 
开发者ID:jronrun,项目名称:benayn,代码行数:8,代码来源:Berkeley.java


示例18: truncateDatabase

import com.sleepycat.je.DatabaseNotFoundException; //导入依赖的package包/类
/**
 * @see Environment#truncateDatabase(Transaction, String, boolean)
 */
public long truncateDatabase(final Transaction txn, 
        final String databaseName, final boolean returnCount) throws DatabaseNotFoundException {
    return delegate().truncateDatabase(txn, databaseName, returnCount);
}
 
开发者ID:jronrun,项目名称:benayn,代码行数:8,代码来源:Berkeley.java


示例19: doRemoveDb

import com.sleepycat.je.DatabaseNotFoundException; //导入依赖的package包/类
/**
 * Remove the database by deleting the nameLN.
 *
 * @return a handle to the renamed database
 *
 * @throws DatabaseNotFoundException if the operation fails because the
 * given DB name is not found, or the non-null checkId argument does not
 * match the database identified by databaseName.
 */
private DatabaseImpl doRemoveDb(Locker locker,
                                String databaseName,
                                DatabaseId checkId,
                                final DbOpReplicationContext repContext)
    throws DatabaseNotFoundException, NeedRepLockerException {

    CursorImpl nameCursor = null;

    final NameLockResult result = lockNameLN
        (locker, databaseName, "remove", new GetRepContext() {
        
        public ReplicationContext get(DatabaseImpl dbImpl) {
            return (repContext != null) ?
                repContext :
                dbImpl.getOperationRepContext(REMOVE);
        }
    });

    final ReplicationContext useRepContext = result.repContext;
    try {
        nameCursor = result.nameCursor;
        if (checkId != null && !checkId.equals(result.nameLN.getId())) {
            throw new DatabaseNotFoundException
                ("ID mismatch: " + databaseName);
        }

        /*
         * Delete the NameLN. There's no need to mark any Database
         * handle invalid, because the handle must be closed when we
         * take action and any further use of the handle will re-look
         * up the database.
         */
        nameCursor.delete(useRepContext);

        /*
         * Schedule database for final deletion during commit. This
         * should be the last action taken, since this will take
         * effect immediately for non-txnal lockers.
         *
         * Do not call releaseDb here on result.dbImpl, since that is
         * taken care of by markDeleteAtTxnEnd.
         */
        locker.markDeleteAtTxnEnd(result.dbImpl, true);
        return result.dbImpl;
    } finally {
        if (nameCursor != null) {
            nameCursor.close();
        }
    }
}
 
开发者ID:prat0318,项目名称:dbms,代码行数:60,代码来源:DbTree.java


示例20: runLDiff

import com.sleepycat.je.DatabaseNotFoundException; //导入依赖的package包/类
public void runLDiff(DbBlocks request, Protocol protocol)
    throws IOException {

    Database db = null;
    Cursor cursor = null;
    try{
        db = env.openDatabase
            (null, request.getDbName(), dbConfig);
        protocol.write(protocol.new BlockListStart(), channel);
        LDiffConfig cfg = new LDiffConfig();
        cfg.setBlockSize(request.getBlockSize());
        LDiff ldf = new LDiff(cfg);
        /* Use the Iterator to stream the blocks across the wire. */
        Iterator<Block> blocks = ldf.iterator(db);
        while (blocks.hasNext()) {
            protocol.write(protocol.new BlockInfo(blocks.next()),
                    channel);
        }
        protocol.write(protocol.new BlockListEnd(), channel);

        /* Start to do the record difference analysis. */
        Message msg = protocol.read(channel);
        if (msg.getOp() == Protocol.REMOTE_DIFF_REQUEST) {
            cursor = db.openCursor(null, null);
            sendDiffArea(cursor, (RemoteDiffRequest) msg, protocol);
            runDiffAnalysis(cursor, protocol);
        } else if (msg.getOp() != Protocol.DONE) {
            protocol.write(protocol.new ProtocolError
                    ("Invalid message: " + msg), channel);
        }
    } catch (DatabaseNotFoundException e) {
        protocol.write(protocol.new DbMismatch(e.getMessage()),
                       channel);
    } finally {
        if (cursor != null) {
            cursor.close();
        }
        if (db != null) {
            db.close();
        }
    }
}
 
开发者ID:prat0318,项目名称:dbms,代码行数:43,代码来源:LDiffService.java



注:本文中的com.sleepycat.je.DatabaseNotFoundException类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java JobExecutor类代码示例发布时间:2022-05-23
下一篇:
Java PngChunkTRNS类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap