Codota Logo
FsVolumeReference.close
Code IndexAdd Codota to your IDE (free)

How to use
close
method
in
org.apache.hadoop.hdfs.server.datanode.fsdataset.FsVolumeReference

Best Java code snippets using org.apache.hadoop.hdfs.server.datanode.fsdataset.FsVolumeReference.close (Showing top 9 results out of 315)

  • Common ways to obtain FsVolumeReference
private void myMethod () {
FsVolumeReference f =
  • Codota IconFsVolumeImpl fsVolumeImpl;fsVolumeImpl.obtainReference()
  • Codota IconReplicaInfo replicaInfo;replicaInfo.getVolume().obtainReference()
  • Codota IconFsVolumeSpi fsVolumeSpi;fsVolumeSpi.obtainReference()
  • Smart code suggestions by Codota
}
origin: org.apache.hadoop/hadoop-hdfs

@Override
public void close() throws IOException {
 if (this.volumeReference != null) {
  volumeReference.close();
 }
}
origin: org.apache.hadoop/hadoop-hdfs

 @Override
 public void close() throws IOException {
  IOException ioe = null;
  for (FsVolumeReference ref : references) {
   try {
    ref.close();
   } catch (IOException e) {
    ioe = e;
   }
  }
  references.clear();
  if (ioe != null) {
   throw ioe;
  }
 }
}
origin: org.apache.hadoop/hadoop-hdfs

/**
 * Moves a given block from one volume to another volume. This is used by disk
 * balancer.
 *
 * @param block       - ExtendedBlock
 * @param destination - Destination volume
 * @return Old replica info
 */
@Override
public ReplicaInfo moveBlockAcrossVolumes(ExtendedBlock block, FsVolumeSpi
  destination) throws IOException {
 ReplicaInfo replicaInfo = getReplicaInfo(block);
 if (replicaInfo.getState() != ReplicaState.FINALIZED) {
  throw new ReplicaNotFoundException(
    ReplicaNotFoundException.UNFINALIZED_REPLICA + block);
 }
 FsVolumeReference volumeRef = null;
 try (AutoCloseableLock lock = datasetLock.acquire()) {
  volumeRef = destination.obtainReference();
 }
 try {
  moveBlock(block, replicaInfo, volumeRef);
 } finally {
  if (volumeRef != null) {
   volumeRef.close();
  }
 }
 return replicaInfo;
}
origin: io.prestosql.hadoop/hadoop-apache

@Override
public void close() throws IOException {
 if (this.volumeReference != null) {
  volumeReference.close();
 }
}
origin: ch.cern.hadoop/hadoop-hdfs

@Override
public void close() throws IOException {
 if (this.volumeReference != null) {
  volumeReference.close();
 }
}
origin: org.apache.hadoop/hadoop-hdfs

} finally {
 if (volumeRef != null) {
  volumeRef.close();
origin: ch.cern.hadoop/hadoop-hdfs

@Test
public void testReleaseVolumeRefIfNoBlockScanner() throws IOException {
 FsVolumeList volumeList = new FsVolumeList(
   Collections.<VolumeFailureInfo>emptyList(), null, blockChooser);
 File volDir = new File(baseDir, "volume-0");
 volDir.mkdirs();
 FsVolumeImpl volume = new FsVolumeImpl(dataset, "storage-id", volDir,
   conf, StorageType.DEFAULT);
 FsVolumeReference ref = volume.obtainReference();
 volumeList.addVolume(ref);
 try {
  ref.close();
  fail("Should throw exception because the reference is closed in "
    + "VolumeList#addVolume().");
 } catch (IllegalStateException e) {
 }
}
origin: ch.cern.hadoop/hadoop-hdfs

} finally {
 if (volumeRef != null) {
  volumeRef.close();
origin: io.prestosql.hadoop/hadoop-apache

} finally {
 if (volumeRef != null) {
  volumeRef.close();
org.apache.hadoop.hdfs.server.datanode.fsdatasetFsVolumeReferenceclose

Javadoc

Decrease the reference count of the volume.

Popular methods of FsVolumeReference

  • getVolume
    Returns the underlying volume object. Return null if the reference was released.

Popular in Java

  • Making http requests using okhttp
  • setScale (BigDecimal)
  • scheduleAtFixedRate (ScheduledExecutorService)
    Creates and executes a periodic action that becomes enabled first after the given initial delay, and
  • getSystemService (Context)
  • Socket (java.net)
    Provides a client-side TCP socket.
  • Iterator (java.util)
    An iterator over a collection. Iterator takes the place of Enumeration in the Java Collections Frame
  • Locale (java.util)
    A Locale object represents a specific geographical, political, or cultural region. An operation that
  • Notification (javax.management)
  • StringUtils (org.apache.commons.lang)
    Operations on java.lang.String that arenull safe. * IsEmpty/IsBlank - checks if a String contains
  • Runner (org.openjdk.jmh.runner)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now