Package org.apache.hadoop.hdfs.server.namenode.snapshot

Examples of org.apache.hadoop.hdfs.server.namenode.snapshot.INodeFileUnderConstructionWithSnapshot


        INodeFile oldnode = INodeFile.valueOf(iip.getINode(0), path);
        cons.setLocalName(oldnode.getLocalNameBytes());
        cons.setParent(oldnode.getParent());

        if (oldnode instanceof INodeFileWithSnapshot) {
          cons = new INodeFileUnderConstructionWithSnapshot(cons,
              ((INodeFileWithSnapshot)oldnode).getDiffs());
        }

        fsDir.replaceINodeFile(path, oldnode, cons);
        namesystem.leaseManager.addLease(cons.getClientName(), path);
View Full Code Here


        INodeFile oldnode = INodeFile.valueOf(iip.getINode(0), path);
        cons.setLocalName(oldnode.getLocalNameBytes());
        cons.setParent(oldnode.getParent());

        if (oldnode instanceof INodeFileWithSnapshot) {
          cons = new INodeFileUnderConstructionWithSnapshot(cons,
              ((INodeFileWithSnapshot)oldnode).getDiffs());
        }

        fsDir.replaceINodeFile(path, oldnode, cons);
        namesystem.leaseManager.addLease(cons.getClientName(), path);
View Full Code Here

  /** Replace a child {@link INodeFile} with an {@link INodeFileUnderConstructionWithSnapshot}. */
  INodeFileUnderConstructionWithSnapshot replaceChild4INodeFileUcWithSnapshot(
      final INodeFileUnderConstruction child, final INodeMap inodeMap) {
    Preconditions.checkArgument(!(child instanceof INodeFileUnderConstructionWithSnapshot),
        "Child file is already an INodeFileUnderConstructionWithSnapshot, child=" + child);
    final INodeFileUnderConstructionWithSnapshot newChild
        = new INodeFileUnderConstructionWithSnapshot(child, null);
    replaceChildFile(child, newChild, inodeMap);
    return newChild;
  }
View Full Code Here

 
  @Override
  public INodeFileUnderConstruction recordModification(final Snapshot latest,
      final INodeMap inodeMap) throws QuotaExceededException {
    if (isInLatestSnapshot(latest)) {
      INodeFileUnderConstructionWithSnapshot newFile = getParent()
          .replaceChild4INodeFileUcWithSnapshot(this, inodeMap)
          .recordModification(latest, inodeMap);
      return newFile;
    } else {
      return this;
View Full Code Here

 
  @Override
  public INodeFileUnderConstruction recordModification(final Snapshot latest,
      final INodeMap inodeMap) throws QuotaExceededException {
    if (isInLatestSnapshot(latest)) {
      INodeFileUnderConstructionWithSnapshot newFile = getParent()
          .replaceChild4INodeFileUcWithSnapshot(this, inodeMap)
          .recordModification(latest, inodeMap);
      return newFile;
    } else {
      return this;
View Full Code Here

          modificationTime, atime, blocks, replication, blockSize);
      if (underConstruction) {
        INodeFileUnderConstruction fileUC = new INodeFileUnderConstruction(
            file, clientName, clientMachine, null);
        return fileDiffs == null ? fileUC :
          new INodeFileUnderConstructionWithSnapshot(fileUC, fileDiffs);
      } else {
        return fileDiffs == null ? file :
          new INodeFileWithSnapshot(file, fileDiffs);
      }
    } else if (numBlocks == -1) {
View Full Code Here

        } else {
          cons.setParent(oldnode.getParent());
        }

        if (oldnode instanceof INodeFileWithSnapshot) {
          cons = new INodeFileUnderConstructionWithSnapshot(cons,
              ((INodeFileWithSnapshot) oldnode).getDiffs());
        }

        if (!inSnapshot) {
          fsDir.replaceINodeFile(path, oldnode, cons);
View Full Code Here

  /** Replace a child {@link INodeFile} with an {@link INodeFileUnderConstructionWithSnapshot}. */
  INodeFileUnderConstructionWithSnapshot replaceChild4INodeFileUcWithSnapshot(
      final INodeFileUnderConstruction child, final INodeMap inodeMap) {
    Preconditions.checkArgument(!(child instanceof INodeFileUnderConstructionWithSnapshot),
        "Child file is already an INodeFileUnderConstructionWithSnapshot, child=" + child);
    final INodeFileUnderConstructionWithSnapshot newChild
        = new INodeFileUnderConstructionWithSnapshot(child, null);
    replaceChildFile(child, newChild, inodeMap);
    return newChild;
  }
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hdfs.server.namenode.snapshot.INodeFileUnderConstructionWithSnapshot

Copyright © 2018 www.massapicom. 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.