Examples of writeData()


Examples of org.apache.helix.manager.zk.ZkClient.writeData()

      smallRecord.setSimpleField(i + "", bufStr);
    }

    String path1 = "/" + root + "/test1";
    zkClient.createPersistent(path1, true);
    zkClient.writeData(path1, smallRecord);

    ZNRecord record = zkClient.readData(path1);
    Assert.assertTrue(serializer.serialize(record).length > 900 * 1024);

    // oversized data doesn't create any data on zk
View Full Code Here

Examples of org.apache.helix.manager.zk.ZkClient.writeData()

      largeRecord.setSimpleField(i + "", bufStr);
    }
    String path2 = "/" + root + "/test2";
    zkClient.createPersistent(path2, true);
    try {
      zkClient.writeData(path2, largeRecord);
      Assert.fail("Should fail because data size is larger than 1M");
    } catch (HelixException e) {
      // OK
    }
    record = zkClient.readData(path2);
View Full Code Here

Examples of org.apache.helix.manager.zk.ZkClient.writeData()

    Assert.assertNull(record);

    // oversized write doesn't overwrite existing data on zk
    record = zkClient.readData(path1);
    try {
      zkClient.writeData(path1, largeRecord);
      Assert.fail("Should fail because data size is larger than 1M");
    } catch (HelixException e) {
      // OK
    }
    ZNRecord recordNew = zkClient.readData(path1);
View Full Code Here

Examples of org.apache.helix.manager.zk.ZkClient.writeData()

        try {
          Thread.sleep(3000);
          final ZkClient zkClient = new ZkClient(ZK_ADDR);
          zkClient.setZkSerializer(new ZNRecordSerializer());
          zkClient.createPersistent(pathChild1, true);
          zkClient.writeData(pathChild1, record);
        } catch (InterruptedException e) {
          logger.error("Interrupted sleep", e);
        }
      }
    }.start();
View Full Code Here

Examples of org.apache.helix.manager.zk.ZkClient.writeData()

        try {
          Thread.sleep(3000);
          final ZkClient zkClient = new ZkClient(_zkaddr);
          zkClient.setZkSerializer(new ZNRecordSerializer());
          zkClient.createPersistent(pathChild1, true);
          zkClient.writeData(pathChild1, record);
        } catch (InterruptedException e) {
          logger.error("Interrupted sleep", e);
        }
      }
    }.start();
View Full Code Here

Examples of org.apache.poi.poifs.property.DocumentProperty.writeData()

        checkDocument(document, array);
        document.setStartBlock(0x12345678);   // what a big file!!
        DocumentProperty      property = document.getDocumentProperty();
        ByteArrayOutputStream stream   = new ByteArrayOutputStream();

        property.writeData(stream);
        byte[] output = stream.toByteArray();
        byte[] array2 =
        {
            ( byte ) 'f', ( byte ) 0, ( byte ) 'o', ( byte ) 0, ( byte ) 'o',
            ( byte ) 0, ( byte ) 'b', ( byte ) 0, ( byte ) 'a', ( byte ) 0,
View Full Code Here

Examples of org.apache.poi.poifs.property.DocumentProperty.writeData()

                                             offset);
        ByteArrayOutputStream stream   = new ByteArrayOutputStream(128);
        byte[]                expected = new byte[ 128 ];

        System.arraycopy(input, offset, expected, 0, 128);
        property.writeData(stream);
        byte[] output = stream.toByteArray();

        assertEquals(128, output.length);
        for (int j = 0; j < 128; j++)
        {
View Full Code Here

Examples of org.apache.poi.poifs.property.DocumentProperty.writeData()

        {
            testblock[ index * 2 ] = name_bytes[ index ];
        }
        ByteArrayOutputStream stream = new ByteArrayOutputStream(512);

        property.writeData(stream);
        byte[] output = stream.toByteArray();

        assertEquals(testblock.length, output.length);
        for (int j = 0; j < testblock.length; j++)
        {
View Full Code Here

Examples of org.apache.poi.poifs.property.DocumentProperty.writeData()

        checkDocument(document, array);
        document.setStartBlock(0x12345678);   // what a big file!!
        DocumentProperty      property = document.getDocumentProperty();
        ByteArrayOutputStream stream   = new ByteArrayOutputStream();

        property.writeData(stream);
        byte[] output = stream.toByteArray();
        byte[] array2 =
        {
            ( byte ) 'f', ( byte ) 0, ( byte ) 'o', ( byte ) 0, ( byte ) 'o',
            ( byte ) 0, ( byte ) 'b', ( byte ) 0, ( byte ) 'a', ( byte ) 0,
View Full Code Here

Examples of org.apache.poi.poifs.property.DocumentProperty.writeData()

                                             offset);
        ByteArrayOutputStream stream   = new ByteArrayOutputStream(128);
        byte[]                expected = new byte[ 128 ];

        System.arraycopy(input, offset, expected, 0, 128);
        property.writeData(stream);
        byte[] output = stream.toByteArray();

        assertEquals(128, output.length);
        for (int j = 0; j < 128; j++)
        {
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.