/** * Constructs an environment from another environment * * @param env Environment */ @VisibleForTesting public Environment(Environment env) throws Exception { this.table = env.table; this.auths = env.auths; this.accumuloInstance = env.accumuloInstance; this.observers = env.observers; this.client = env.client; this.accumuloInstanceID = env.accumuloInstanceID; this.fluoApplicationID = env.fluoApplicationID; this.config = env.config; this.resources = new SharedResources(this); }
/** * Constructs an environment from another environment * * @param env Environment */ @VisibleForTesting public Environment(Environment env) throws Exception { this.table = env.table; this.auths = env.auths; this.accumuloInstance = env.accumuloInstance; this.observers = env.observers; this.conn = env.conn; this.accumuloInstanceID = env.accumuloInstanceID; this.fluoApplicationID = env.fluoApplicationID; this.config = env.config; this.resources = new SharedResources(this); }
public void setAuthorizations(Authorizations auths) { this.auths = auths; // TODO the following is a big hack, this method is currently not exposed in API resources.close(); try { this.resources = new SharedResources(this); } catch (TableNotFoundException e) { throw new RuntimeException(e); } }
public void setAuthorizations(Authorizations auths) { this.auths = auths; // TODO the following is a big hack, this method is currently not exposed in API resources.close(); try { this.resources = new SharedResources(this); } catch (TableNotFoundException e) { throw new RuntimeException(e); } }
/** * Constructs an environment from given FluoConfiguration * * @param configuration Configuration used to configure environment */ public Environment(FluoConfiguration configuration) { config = configuration; client = AccumuloUtil.getClient(config); readZookeeperConfig(); ensureDeletesAreDisabled(); if (!client.info().getInstanceName().equals(accumuloInstance)) { throw new IllegalArgumentException("unexpected accumulo instance name " + client.info().getInstanceName() + " != " + accumuloInstance); } if (!client.getInstanceID().equals(accumuloInstanceID)) { throw new IllegalArgumentException("unexpected accumulo instance id " + client.getInstanceID() + " != " + accumuloInstanceID); } try { resources = new SharedResources(this); } catch (TableNotFoundException e1) { throw new IllegalStateException(e1); } }
/** * Constructs an environment from given FluoConfiguration * * @param configuration Configuration used to configure environment */ public Environment(FluoConfiguration configuration) { config = configuration; conn = AccumuloUtil.getConnector(config); readZookeeperConfig(); if (!conn.getInstance().getInstanceName().equals(accumuloInstance)) { throw new IllegalArgumentException("unexpected accumulo instance name " + conn.getInstance().getInstanceName() + " != " + accumuloInstance); } if (!conn.getInstance().getInstanceID().equals(accumuloInstanceID)) { throw new IllegalArgumentException("unexpected accumulo instance id " + conn.getInstance().getInstanceID() + " != " + accumuloInstanceID); } try { resources = new SharedResources(this); } catch (TableNotFoundException e1) { throw new IllegalStateException(e1); } }