storagePolicyId, blockType); newNode.setLocalName(localName); INodesInPath iip = fsd.addINode(existing, newNode, permissions.getPermission());
modTime, modTime, replicationFactor, ecPolicyID, preferredBlockSize, blockType); newNode.setLocalName(localName); newNode.toUnderConstruction(clientName, clientMachine); newiip = fsd.addINode(existing, newNode, permissions.getPermission());
INodeFile newNode = newINodeFile(allocateNewInodeId(), permissions, modTime, modTime, replication, preferredBlockSize); newNode.setLocalName(DFSUtil.string2Bytes(localName)); newNode.toUnderConstruction(clientName, clientMachine);
newNode.setLocalName(localName); try { INodesInPath iip = addINode(existing, newNode);
/** * Creates the required number of files with one block each * @param nCount Number of INodes to create * @return Array of INode files */ private INodeFile[] createINodeFiles(int nCount, String fileNamePrefix) { if(nCount <= 0) return new INodeFile[1]; replication = 3; preferredBlockSize = 128 * 1024 * 1024; INodeFile[] iNodes = new INodeFile[nCount]; for (int i = 0; i < nCount; i++) { iNodes[i] = new INodeFile(i, null, perm, 0L, 0L, null, replication, preferredBlockSize, (byte)0); iNodes[i].setLocalName(DFSUtil.string2Bytes(fileNamePrefix + i)); BlockInfoContiguous newblock = new BlockInfoContiguous(replication); iNodes[i].addBlock(newblock); } return iNodes; }
newnode.setLocalName(oldnode.getLocalNameBytes()); parent.addChild(newnode, false); inodes[inodes.length-1] = newnode;
newNode.setLocalName(localName); try { INodesInPath iip = addINode(existing, newNode);
INodeFile newNode = newINodeFile(allocateNewInodeId(), permissions, modTime, modTime, replication, preferredBlockSize); newNode.setLocalName(DFSUtil.string2Bytes(localName)); newNode.toUnderConstruction(clientName, clientMachine);
@Test public void testGetFullPathName() { replication = 3; preferredBlockSize = 128*1024*1024; INodeFile inf = createINodeFile(replication, preferredBlockSize); inf.setLocalName(DFSUtil.string2Bytes("f")); INodeDirectory root = new INodeDirectory(INodeId.GRANDFATHER_INODE_ID, INodeDirectory.ROOT_NAME, perm, 0L); INodeDirectory dir = new INodeDirectory(INodeId.GRANDFATHER_INODE_ID, DFSUtil.string2Bytes("d"), perm, 0L); assertEquals("f", inf.getFullPathName()); dir.addChild(inf); assertEquals("d"+Path.SEPARATOR+"f", inf.getFullPathName()); root.addChild(dir); assertEquals(Path.SEPARATOR+"d"+Path.SEPARATOR+"f", inf.getFullPathName()); assertEquals(Path.SEPARATOR+"d", dir.getFullPathName()); assertEquals(Path.SEPARATOR, root.getFullPathName()); }