use of org.neo4j.ogm.domain.gh806.Container in project pravega by pravega.
the class PravegaControllerService method createPravegaControllerApp.
/**
* To configure the controller app.
*
* @return App instance of marathon app
*/
private App createPravegaControllerApp() {
App app = new App();
app.setId(this.id);
app.setCpus(cpu);
app.setMem(mem);
app.setInstances(instances);
app.setConstraints(setConstraint("hostname", "UNIQUE"));
app.setContainer(new Container());
app.getContainer().setType(CONTAINER_TYPE);
app.getContainer().setDocker(new Docker());
app.getContainer().getDocker().setImage(IMAGE_PATH + "/nautilus/pravega:" + PRAVEGA_VERSION);
String zk = zkUri.getHost() + ":" + ZKSERVICE_ZKPORT;
// set port
app.setPortDefinitions(Arrays.asList(createPortDefinition(CONTROLLER_PORT), createPortDefinition(REST_PORT)));
app.setRequirePorts(true);
List<HealthCheck> healthCheckList = new ArrayList<HealthCheck>();
healthCheckList.add(setHealthCheck(300, "TCP", false, 60, 20, 0, CONTROLLER_PORT));
app.setHealthChecks(healthCheckList);
String controllerSystemProperties = "-Xmx512m" + buildSystemProperty(propertyName("zk.connect.uri"), zk) + buildSystemProperty(propertyName("service.rpc.published.host.nameOrIp"), this.id + ".marathon.mesos") + buildSystemProperty(propertyName("service.rpc.published.port"), String.valueOf(CONTROLLER_PORT)) + buildSystemProperty(propertyName("service.rpc.listener.port"), String.valueOf(CONTROLLER_PORT)) + buildSystemProperty(propertyName("service.rest.listener.port"), String.valueOf(REST_PORT)) + buildSystemProperty("log.level", "DEBUG") + buildSystemProperty("log.dir", "$MESOS_SANDBOX/pravegaLogs") + buildSystemProperty("curator-default-session-timeout", String.valueOf(10 * 1000)) + buildSystemProperty(propertyName("transaction.lease.count.max"), String.valueOf(600 * 1000)) + buildSystemProperty(propertyName("retention.frequency.minutes"), String.valueOf(2));
Map<String, Object> map = new HashMap<>();
map.put("PRAVEGA_CONTROLLER_OPTS", controllerSystemProperties);
app.setEnv(map);
app.setArgs(Arrays.asList("controller"));
return app;
}
use of org.neo4j.ogm.domain.gh806.Container in project pravega by pravega.
the class PravegaSegmentStoreService method createPravegaSegmentStoreApp.
private App createPravegaSegmentStoreApp() {
App app = new App();
app.setId(this.id);
app.setCpus(cpu);
app.setMem(mem);
app.setInstances(instances);
// set constraints
app.setConstraints(setConstraint("hostname", "UNIQUE"));
// docker container
app.setContainer(new Container());
app.getContainer().setType(CONTAINER_TYPE);
app.getContainer().setDocker(new Docker());
// set the image and network
app.getContainer().getDocker().setImage(IMAGE_PATH + "/nautilus/pravega:" + PRAVEGA_VERSION);
// set port
app.setPortDefinitions(Arrays.asList(createPortDefinition(SEGMENTSTORE_PORT)));
app.setRequirePorts(true);
// healthchecks
List<HealthCheck> healthCheckList = new ArrayList<HealthCheck>();
healthCheckList.add(setHealthCheck(300, "TCP", false, 60, 20, 0, SEGMENTSTORE_PORT));
app.setHealthChecks(healthCheckList);
// set env
String zk = zkUri.getHost() + ":" + ZKSERVICE_ZKPORT;
// Environment variables to configure SS service.
Map<String, Object> map = new HashMap<>();
map.put("ZK_URL", zk);
map.put("BK_ZK_URL", zk);
map.put("CONTROLLER_URL", conUri.toString());
getCustomEnvVars(map, SEGMENTSTORE_EXTRA_ENV);
// Properties set to override defaults for system tests
String hostSystemProperties = "-Xmx1024m" + buildSystemProperty("autoScale.muteInSeconds", "120") + buildSystemProperty("autoScale.cooldownInSeconds", "120") + buildSystemProperty("autoScale.cacheExpiryInSeconds", "120") + buildSystemProperty("autoScale.cacheCleanUpInSeconds", "120") + buildSystemProperty("log.level", "DEBUG") + buildSystemProperty("log.dir", "$MESOS_SANDBOX/pravegaLogs") + buildSystemProperty("curator-default-session-timeout", String.valueOf(30 * 1000)) + buildSystemProperty("hdfs.replaceDataNodesOnFailure", "false");
map.put("PRAVEGA_SEGMENTSTORE_OPTS", hostSystemProperties);
app.setEnv(map);
app.setArgs(Arrays.asList("segmentstore"));
return app;
}
use of org.neo4j.ogm.domain.gh806.Container in project WildChests by BG-Software-LLC.
the class NMSInventory_v1_12_R1 method openPage.
@Override
public void openPage(Player player, com.bgsoftware.wildchests.objects.inventory.CraftWildInventory inventory) {
EntityPlayer entityPlayer = ((CraftPlayer) player).getHandle();
String title = inventory.getTitle();
Container container = createContainer(entityPlayer.inventory, entityPlayer, inventory);
container.windowId = entityPlayer.nextContainerCounter();
TileEntityWildChest tileEntityWildChest = getTileEntity(inventory.getOwner());
entityPlayer.playerConnection.sendPacket(new PacketPlayOutOpenWindow(container.windowId, tileEntityWildChest.getContainerName(), new ChatComponentText(title), inventory.getSize()));
entityPlayer.activeContainer = container;
entityPlayer.activeContainer.addSlotListener(entityPlayer);
}
use of org.neo4j.ogm.domain.gh806.Container in project WildChests by BG-Software-LLC.
the class NMSInventory_v1_8_R3 method openPage.
@Override
public void openPage(Player player, com.bgsoftware.wildchests.objects.inventory.CraftWildInventory inventory) {
EntityPlayer entityPlayer = ((CraftPlayer) player).getHandle();
String title = inventory.getTitle();
Container container = createContainer(entityPlayer.inventory, entityPlayer, inventory);
container.windowId = entityPlayer.nextContainerCounter();
TileEntityWildChest tileEntityWildChest = getTileEntity(inventory.getOwner());
entityPlayer.playerConnection.sendPacket(new PacketPlayOutOpenWindow(container.windowId, tileEntityWildChest.getContainerName(), new ChatComponentText(title), inventory.getSize()));
entityPlayer.activeContainer = container;
entityPlayer.activeContainer.addSlotListener(entityPlayer);
}
use of org.neo4j.ogm.domain.gh806.Container in project mdsal by opendaylight.
the class Mdsal298Test method testUnkeyedDataTreeModification.
@Test
public void testUnkeyedDataTreeModification() throws InterruptedException, ExecutionException {
final DataTreeChangeListener<Container> listener = assertWrittenContainer(Container.QNAME, Container.class, new ContainerBuilder().build());
final DOMDataTreeWriteTransaction domTx = getDomBroker().newWriteOnlyTransaction();
domTx.put(CONFIGURATION, YangInstanceIdentifier.create(CONTAINER_NID).node(Unkeyed.QNAME), Builders.unkeyedListBuilder().withNodeIdentifier(new NodeIdentifier(Unkeyed.QNAME)).withChild(Builders.unkeyedListEntryBuilder().withNodeIdentifier(new NodeIdentifier(Unkeyed.QNAME)).addChild(ImmutableNodes.leafNode(FOO_QNAME, "foo")).build()).withChild(Builders.unkeyedListEntryBuilder().withNodeIdentifier(new NodeIdentifier(Unkeyed.QNAME)).addChild(ImmutableNodes.leafNode(FOO_QNAME, "bar")).build()).build());
domTx.commit().get();
final ArgumentCaptor<Collection> captor = ArgumentCaptor.forClass(Collection.class);
verify(listener).onDataTreeChanged(captor.capture());
Collection<DataTreeModification<Container>> capture = captor.getValue();
assertEquals(1, capture.size());
final DataTreeModification<Container> change = capture.iterator().next();
assertEquals(CONTAINER_TID, change.getRootPath());
final DataObjectModification<Container> changedContainer = change.getRootNode();
assertEquals(Item.of(Container.class), changedContainer.getIdentifier());
assertEquals(ModificationType.WRITE, changedContainer.getModificationType());
final Container containerAfter = changedContainer.getDataAfter();
assertEquals(new ContainerBuilder().setUnkeyed(List.of(new UnkeyedBuilder().setFoo("foo").build(), new UnkeyedBuilder().setFoo("bar").build())).build(), containerAfter);
final Collection<? extends DataObjectModification<?>> changedChildren = changedContainer.getModifiedChildren();
assertEquals(0, changedChildren.size());
}
Aggregations