@Override
    public ProcNodeInterface lookup(String dbIdOrName) throws AnalysisException {
        if (globalStateMgr == null) {
            throw new AnalysisException("globalStateMgr is null");
        }
        if (Strings.isNullOrEmpty(dbIdOrName)) {
            throw new AnalysisException("database id or name is null or empty");
        }

        Database db;
        try {
            db = globalStateMgr.getDb(Long.parseLong(dbIdOrName));
        } catch (NumberFormatException e) {
            db = globalStateMgr.getDb(dbIdOrName);
        }

        if (db == null) {
            throw new AnalysisException("Unknown database id or name \"" + dbIdOrName + "\"");
        }

        return new TablesProcDir(db);
    }
@Test
    public void testLookupInvalid() {
        DbsProcDir dir;
        ProcNodeInterface node;

        dir = new DbsProcDir(globalStateMgr);
        try {
            node = dir.lookup(null);
        } catch (AnalysisException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }

        try {
            node = dir.lookup("");
        } catch (AnalysisException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }