@Override public AggregateConf refresh() throws Exception { return resolved ? state.getInstanceDefinitionSnapshot() : state.getUnresolvedInstanceDefinition(); } }
protected AggregateConf getAggregateConf() { return slider.getAppState().getInstanceDefinitionSnapshot(); } }
protected AggregateConf getAggregateConf() { return slider.getAppState().getInstanceDefinitionSnapshot(); } }
@Override public AggregateConf refresh() throws Exception { return resolved ? state.getInstanceDefinitionSnapshot() : state.getUnresolvedInstanceDefinition(); } }
@Override public ConfTree refresh() throws Exception { AggregateConf aggregateConf = unresolved ? state.getUnresolvedInstanceDefinition(): state.getInstanceDefinitionSnapshot(); ConfTree ct = resources ? aggregateConf.getResources() : aggregateConf.getAppConf(); return new ConfTreeSerDeser().fromInstance(ct); } }
@Override public ConfTree refresh() throws Exception { AggregateConf aggregateConf = unresolved ? state.getUnresolvedInstanceDefinition(): state.getInstanceDefinitionSnapshot(); ConfTree ct = resources ? aggregateConf.getResources() : aggregateConf.getAppConf(); return new ConfTreeSerDeser().fromInstance(ct); } }
@Override public Messages.GetInstanceDefinitionResponseProto getInstanceDefinition( Messages.GetInstanceDefinitionRequestProto request) throws IOException, YarnException { onRpcCall("getinstancedefinition"); String internal; String resources; String app; AggregateConf instanceDefinition = state.getInstanceDefinitionSnapshot(); internal = instanceDefinition.getInternal().toJson(); resources = instanceDefinition.getResources().toJson(); app = instanceDefinition.getAppConf().toJson(); assert internal != null; assert resources != null; assert app != null; log.debug("Generating getInstanceDefinition Response"); Messages.GetInstanceDefinitionResponseProto.Builder builder = Messages.GetInstanceDefinitionResponseProto.newBuilder(); builder.setInternal(internal); builder.setResources(resources); builder.setApplication(app); return builder.build(); }
@Override public Messages.GetInstanceDefinitionResponseProto getInstanceDefinition( Messages.GetInstanceDefinitionRequestProto request) throws IOException, YarnException { onRpcCall("getinstancedefinition"); String internal; String resources; String app; AggregateConf instanceDefinition = state.getInstanceDefinitionSnapshot(); internal = instanceDefinition.getInternal().toJson(); resources = instanceDefinition.getResources().toJson(); app = instanceDefinition.getAppConf().toJson(); assert internal != null; assert resources != null; assert app != null; log.debug("Generating getInstanceDefinition Response"); Messages.GetInstanceDefinitionResponseProto.Builder builder = Messages.GetInstanceDefinitionResponseProto.newBuilder(); builder.setInternal(internal); builder.setResources(resources); builder.setApplication(app); return builder.build(); }
treeOps.set("site.fs.defaultFS", "hdfs://c6409.ambari.apache.org:8020"); treeOps.set(InternalKeys.INTERNAL_DATA_DIR_PATH, "hdfs://c6409.ambari.apache.org:8020/user/yarn/.slider/cluster/cl1/data"); expect(access.getInstanceDefinitionSnapshot()).andReturn(aggConf); expect(access.getInternalsSnapshot()).andReturn(treeOps).anyTimes(); expect(access.getAppConfSnapshot()).andReturn(treeOps).anyTimes();
treeOps.set("site.fs.defaultFS", "hdfs://c6409.ambari.apache.org:8020"); treeOps.set(InternalKeys.INTERNAL_DATA_DIR_PATH, "hdfs://c6409.ambari.apache.org:8020/user/yarn/.slider/cluster/cl1/data"); expect(access.getInstanceDefinitionSnapshot()).andReturn(aggConf); expect(access.getInternalsSnapshot()).andReturn(treeOps).anyTimes(); expect(access.getAppConfSnapshot()).andReturn(treeOps).anyTimes();
treeOps.set("site.fs.defaultFS", "hdfs://HOST1:8020/"); treeOps.set("internal.data.dir.path", "hdfs://HOST1:8020/database"); expect(access.getInstanceDefinitionSnapshot()).andReturn(instanceDefinition); expect(access.getInternalsSnapshot()).andReturn(treeOps).anyTimes(); expect(access.getAppConfSnapshot()).andReturn(treeOps).anyTimes();
treeOps.set("site.fs.defaultFS", "hdfs://HOST1:8020/"); treeOps.set("internal.data.dir.path", "hdfs://HOST1:8020/database"); expect(access.getInstanceDefinitionSnapshot()).andReturn(instanceDefinition); expect(access.getInternalsSnapshot()).andReturn(treeOps).anyTimes(); expect(access.getAppConfSnapshot()).andReturn(treeOps).anyTimes();
int waitForCount = accessor.getInstanceDefinitionSnapshot(). getAppConfOperations().getComponentOptInt(roleGroup, AgentKeys.WAIT_HEARTBEAT, 0);
int waitForCount = accessor.getInstanceDefinitionSnapshot(). getAppConfOperations().getComponentOptInt(roleGroup, AgentKeys.WAIT_HEARTBEAT, 0);
treeOps.set("site.fs.defaultFS", "hdfs://HOST1:8020/"); treeOps.set("internal.data.dir.path", "hdfs://HOST1:8020/database"); expect(access.getInstanceDefinitionSnapshot()).andReturn(instanceDefinition).anyTimes(); expect(access.getInternalsSnapshot()).andReturn(treeOps).anyTimes(); expect(access.getAppConfSnapshot()).andReturn(treeOps).anyTimes();
treeOps.getOrAddComponent("HBASE_MASTER").put(AgentKeys.WAIT_HEARTBEAT, "0"); treeOps.set(OptionKeys.APPLICATION_NAME, "HBASE"); expect(access.getInstanceDefinitionSnapshot()).andReturn(aggConf).anyTimes(); expect(access.getInternalsSnapshot()).andReturn(treeOps).anyTimes(); replay(access, ctx, container, sliderFileSystem, mockFs);
treeOps.getOrAddComponent("HBASE_MASTER").put(AgentKeys.WAIT_HEARTBEAT, "0"); treeOps.set(OptionKeys.APPLICATION_NAME, "HBASE"); expect(access.getInstanceDefinitionSnapshot()).andReturn(aggConf).anyTimes(); expect(access.getInternalsSnapshot()).andReturn(treeOps).anyTimes(); replay(access, ctx, container, sliderFileSystem, mockFs);
treeOps.set("site.fs.defaultFS", "hdfs://HOST1:8020/"); treeOps.set("internal.data.dir.path", "hdfs://HOST1:8020/database"); expect(access.getInstanceDefinitionSnapshot()).andReturn(instanceDefinition).anyTimes(); expect(access.getInternalsSnapshot()).andReturn(treeOps).anyTimes(); expect(access.getAppConfSnapshot()).andReturn(treeOps).anyTimes();