Examples of BlockId


Examples of org.jcoredb.fs.BlockId

    String testStr = "<test> <content> Hello world! </content> </test>";
    byte[] content = testStr.getBytes();
   
    for (int i = 0; i < 200; i++) {

      Block b = new Block(new BlockId(0));
      b.setBytes(content);
     
      blocks.add(b);
     
      BlockId bid = fs.append(b, false);

      blockIds.add(bid);
    }

       
    Block b = fs.read(new BlockId(0,0,111));
   
    assertEquals(testStr, new String(b.getBytes()).substring(0, testStr.length()));
   
    fs.close();
  }
View Full Code Here

Examples of org.jcoredb.fs.BlockId

    String testStr = "<test> <content> Hello world! </content> </test>";
    byte[] content = testStr.getBytes();
   
    for (int i = 0; i < 200; i++) {

      Block b = new Block(new BlockId(0));
      b.setBytes(content);
     
      blocks.add(b);
     
      BlockId bid = fs.append(b, false);

      blockIds.add(bid);
    }
   
    String newTestStr = "<test> <content> Hello world, again! </content> </test>";
View Full Code Here

Examples of org.jcoredb.fs.BlockId

  @Override
  public void create() {
   
    IFileSystem fs = FileSystemRegistry.get(new FileSystemRegKey("localhost", Configs.getFSConfig().getRootDir()));
   
    BlockId blockId = new BlockId(containerId);
    Block block = new Block(blockId);
    block.setBytes(data);
   
    try
    {
      blockId = fs.append(block, only);
     
      JSONNode root = JSONHelper.createSuccessNode();
      JSONAttribute containerId = new JSONAttribute("containerId", ""+blockId.getContainerId(), AttrType.Number);
      JSONAttribute segmentId = new JSONAttribute("segmentId", ""+blockId.getSegmentId(), AttrType.Number);
      JSONAttribute id = new JSONAttribute("blockId", ""+blockId.getId(), AttrType.Number);
      root.add(containerId);
      root.add(segmentId);
      root.add(id);
     
      out.println(root.toJSONString());
View Full Code Here

Examples of org.jcoredb.fs.BlockId

   * @return
   * @throws Exception
   */
  public Block readBlock(int idx) throws BlockReadErr
 
    BlockId blockId = new BlockId(this.container.getId(), this.id, idx);
   
    try
    {
      if (header.isFree(idx))
      {
View Full Code Here

Examples of org.jcoredb.fs.BlockId

  @Override
  public void create() {
   
    IFileSystem fs = FileSystemRegistry.get(new FileSystemRegKey(Constants.HOST, Configs.getFSConfig().getRootDir()));
   
    BlockId blockId = new BlockId(containerId, segmentId, id);
    Block block = new Block(blockId);
    block.setBytes(data);
   
    try
    {
View Full Code Here

Examples of org.jcoredb.fs.BlockId

  @Override
  public void create() {
   
    IFileSystem fs = FileSystemRegistry.get(new FileSystemRegKey(Constants.HOST, Configs.getFSConfig().getRootDir()));
   
    BlockId blockId = new BlockId(containerId, segmentId, id);
   
    try
    {
      fs.delete(blockId, soft);
     
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.