Examples of addBlock()


Examples of org.apache.hadoop.hdfs.server.datanode.DataBlockScanner.addBlock()

        ReplicaInfo diskBlockInfo = new FinalizedReplica(blockId,
            diskFile.length(), diskGS, vol, diskFile.getParentFile());
        volumeMap.add(bpid, diskBlockInfo);
        final DataBlockScanner blockScanner = datanode.getBlockScanner();
        if (blockScanner != null) {
          blockScanner.addBlock(new ExtendedBlock(bpid, diskBlockInfo));
        }
        LOG.warn("Added missing block to memory " + diskBlockInfo);
        return;
      }
      /*
 
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.namenode.AvatarNode.addBlock()

    String clientName = ((DistributedAvatarFileSystem) fs)
        .getClient().getClientName();
   
    // create a file directly and add one block
    nn.create("/test", perm, clientName, true, true, (short) 3, (long) 1024);
    nn.addBlock("/test", clientName);

    assertEquals(1,
        cluster.getPrimaryAvatar(0).avatar.namesystem.getBlocksTotal());
   
    // set lease period to something short
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.namenode.NameNode.addBlock()

        else
          throw new RemoteException(NotReplicatedYetException.class.getName(),
                                    exceptionMsg);
      }
    };
    when(mockNN.addBlock(anyString(),
                         anyString(),
                         any(Block.class),
                         any(DatanodeInfo[].class))).thenAnswer(answer);

    final DFSClient client = new DFSClient(null, mockNN, conf, null);
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.namenode.NameNode.addBlock()

        else
          throw new RemoteException(NotReplicatedYetException.class.getName(),
                                    exceptionMsg);
      }
    };
    when(mockNN.addBlock(anyString(),
                         anyString(),
                         any(Block.class),
                         any(DatanodeInfo[].class))).thenAnswer(answer);

    final DFSClient client = new DFSClient(null, mockNN, conf, null);
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.protocol.NamenodeProtocols.addBlock()

        else
          throw new RemoteException(NotReplicatedYetException.class.getName(),
                                    exceptionMsg);
      }
    };
    when(mockNN.addBlock(anyString(),
                         anyString(),
                         any(ExtendedBlock.class),
                         any(DatanodeInfo[].class))).thenAnswer(answer);

    final DFSClient client = new DFSClient(null, mockNN, conf, null);
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.protocol.NamenodeProtocols.addBlock()

        else
          throw new RemoteException(NotReplicatedYetException.class.getName(),
                                    exceptionMsg);
      }
    };
    when(mockNN.addBlock(anyString(),
                         anyString(),
                         any(ExtendedBlock.class),
                         any(DatanodeInfo[].class),
                         anyLong(), any(String[].class))).thenAnswer(answer);
   
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.protocol.NamenodeProtocols.addBlock()

        else
          throw new RemoteException(NotReplicatedYetException.class.getName(),
                                    exceptionMsg);
      }
    };
    when(mockNN.addBlock(anyString(),
                         anyString(),
                         any(ExtendedBlock.class),
                         any(DatanodeInfo[].class),
                         anyLong(), any(String[].class))).thenAnswer(answer);
   
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.protocol.NamenodeProtocols.addBlock()

        DatanodeDescriptor[] ret =
            (DatanodeDescriptor[]) invocation.callRealMethod();
        count++;
        if(count == 1) { // run second addBlock()
          LOG.info("Starting second addBlock for " + src);
          nn.addBlock(src, "clientName", null, null,
              INodeId.GRANDFATHER_INODE_ID, null);
          LocatedBlocks lbs = nn.getBlockLocations(src, 0, Long.MAX_VALUE);
          assertEquals("Must be one block", 1, lbs.getLocatedBlocks().size());
          lb2 = lbs.get(0);
          assertEquals("Wrong replication",
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.protocol.NamenodeProtocols.addBlock()

        new EnumSetWritable<CreateFlag>(EnumSet.of(CreateFlag.CREATE)),
        true, (short)3, 1024);

    // start first addBlock()
    LOG.info("Starting first addBlock for " + src);
    nn.addBlock(src, "clientName", null, null, INodeId.GRANDFATHER_INODE_ID, null);

    // check locations
    LocatedBlocks lbs = nn.getBlockLocations(src, 0, Long.MAX_VALUE);
    assertEquals("Must be one block", 1, lbs.getLocatedBlocks().size());
    lb1 = lbs.get(0);
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.protocol.NamenodeProtocols.addBlock()

        else
          throw new RemoteException(NotReplicatedYetException.class.getName(),
                                    exceptionMsg);
      }
    };
    when(mockNN.addBlock(anyString(),
                         anyString(),
                         any(ExtendedBlock.class),
                         any(DatanodeInfo[].class))).thenAnswer(answer);

    final DFSClient client = new DFSClient(null, mockNN, conf, null);
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.