Examples of toJsonBytes()


Examples of com.ngdata.hbaseindexer.model.impl.IndexerDefinitionJsonSerDeser.toJsonBytes()

    public void testMinimal() {
        IndexerDefinition indexer = new IndexerDefinitionBuilder()
                .name("index1").build();

        IndexerDefinitionJsonSerDeser serdeser = new IndexerDefinitionJsonSerDeser();
        byte[] json = serdeser.toJsonBytes(indexer);

        IndexerDefinition indexer2 = serdeser.fromJsonBytes(json).build();

        assertEquals(indexer, indexer2);
        assertEquals("index1", indexer.getName());
View Full Code Here

Examples of com.ngdata.hbaseindexer.model.impl.IndexerDefinitionJsonSerDeser.toJsonBytes()

                .lastBatchBuildInfo(
                        new BatchBuildInfo(11L, false, ImmutableMap.of("job-id-2", "url-2"), new String[]{"arg3"}))
                .occVersion(5).build();

        IndexerDefinitionJsonSerDeser serdeser = new IndexerDefinitionJsonSerDeser();
        byte[] json = serdeser.toJsonBytes(indexer);

        IndexerDefinition indexer2 = serdeser.fromJsonBytes(json).build();

        assertEquals("index1", indexer2.getName());
        assertEquals(LifecycleState.DELETE_REQUESTED, indexer2.getLifecycleState());
View Full Code Here

Examples of com.spotify.helios.common.descriptors.AgentInfo.toJsonBytes()

        .setUptime(runtimeMXBean.getUptime())
        .setStartTime(runtimeMXBean.getStartTime())
        .setVersion(Version.POM_VERSION)
        .build();

    nodeUpdater.update(agentInfo.toJsonBytes());
  }

  @Override
  protected ScheduledFuture<?> schedule(final Runnable runnable,
                                        final ScheduledExecutorService executorService) {
View Full Code Here

Examples of com.spotify.helios.common.descriptors.HostInfo.toJsonBytes()

        .setSwapTotalBytes(operatingSystemMXBean.getTotalSwapSpaceSize())
        .setUname(uname)
        .setDockerVersion(dockerVersion())
        .build();

    nodeUpdater.update(hostInfo.toJsonBytes());
  }

  private DockerVersion dockerVersion() throws InterruptedException {
    try {
      final com.spotify.docker.client.messages.Version version = dockerClient.version();
View Full Code Here

Examples of com.spotify.helios.common.descriptors.JobId.toJsonBytes()

    final String taskPath = Paths.configHostJob(host, id);
    final String taskCreationPath = Paths.configHostJobCreation(host, id, operationId);

    final List<Integer> staticPorts = staticPorts(job);
    final Map<String, byte[]> portNodes = Maps.newHashMap();
    final byte[] idJson = id.toJsonBytes();
    for (final int port : staticPorts) {
      final String path = Paths.configHostPort(host, port);
      portNodes.put(path, idJson);
    }
View Full Code Here

Examples of com.spotify.helios.common.descriptors.Task.toJsonBytes()

    assertTaskExists(client, host, deployment.getJobId());

    final String path = Paths.configHostJob(host, jobId);
    final Task task = new Task(job, deployment.getGoal(), Task.EMPTY_DEPLOYER_USER);
    try {
      client.setData(path, task.toJsonBytes());
    } catch (Exception e) {
      throw new HeliosRuntimeException("updating deployment " + deployment +
                                       " on host " + host + " failed", e);
    }
  }
View Full Code Here

Examples of org.lilyproject.util.repo.RecordEvent.toJsonBytes()

    @Test
    public void testRecordEvent_JsonRoundTrip() throws Exception {

        RecordEvent event = new RecordEvent();
        byte[] json = event.toJsonBytes();
        event = new RecordEvent(json, idGenerator);

        assertNull(event.getIndexRecordFilterData());

        SchemaId oldRtId = idGenerator.getSchemaId(UUID.randomUUID());
View Full Code Here

Examples of org.lilyproject.util.repo.RecordEvent.toJsonBytes()

        RecordEvent.IndexRecordFilterData idxSel = new RecordEvent.IndexRecordFilterData();
        event.setIndexRecordFilterData(idxSel);
        idxSel.setOldRecordType(oldRtId);
        idxSel.setNewRecordType(newRtId);

        json = event.toJsonBytes();
        event = new RecordEvent(json, idGenerator);

        assertNotNull(event.getIndexRecordFilterData());
        assertEquals(oldRtId, event.getIndexRecordFilterData().getOldRecordType());
        assertEquals(newRtId, event.getIndexRecordFilterData().getNewRecordType());
View Full Code Here

Examples of org.lilyproject.util.repo.RecordEvent.toJsonBytes()

        idxSel.addChangedField(field1Id, null, null);
        idxSel.addChangedField(field2Id, Bytes.toBytes("foo1"), Bytes.toBytes("foo2"));
        idxSel.addChangedField(field3Id, Bytes.toBytes("foo3"), null);
        idxSel.addChangedField(field4Id, null, Bytes.toBytes("foo4"));

        json = event.toJsonBytes();
        event = new RecordEvent(json, idGenerator);

        List<RecordEvent.FieldChange> fieldChanges = event.getIndexRecordFilterData().getFieldChanges();
        assertEquals(4, fieldChanges.size());
View Full Code Here

Examples of org.lilyproject.util.repo.RecordEvent.toJsonBytes()

    public void testRecordEvent_JsonRoundtrip_TableName() throws IOException {
        final String tableName = "_table_name_";
        RecordEvent recordEvent = new RecordEvent();
        recordEvent.setTableName(tableName);

        byte[] jsonBytes = recordEvent.toJsonBytes();

        RecordEvent deserialized = new RecordEvent(jsonBytes, idGenerator);

        assertEquals(tableName, deserialized.getTableName());
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.