Java 类org.apache.hadoop.hdfs.shortcircuit.ShortCircuitShm 实例源码

项目:hadoop    文件:ShortCircuitRegistry.java   
public synchronized void removeShm(ShortCircuitShm shm) {
  if (LOG.isTraceEnabled()) {
    LOG.debug("removing shm " + shm);
  }
  // Stop tracking the shmId.
  RegisteredShm removedShm = segments.remove(shm.getShmId());
  Preconditions.checkState(removedShm == shm,
      "failed to remove " + shm.getShmId());
  // Stop tracking the slots.
  for (Iterator<Slot> iter = shm.slotIterator(); iter.hasNext(); ) {
    Slot slot = iter.next();
    boolean removed = slots.remove(slot.getBlockId(), slot);
    Preconditions.checkState(removed);
    slot.makeInvalid();
  }
  // De-allocate the memory map and close the shared file. 
  shm.free();
}
项目:aliyun-oss-hadoop-fs    文件:ShortCircuitRegistry.java   
public synchronized void removeShm(ShortCircuitShm shm) {
  if (LOG.isTraceEnabled()) {
    LOG.debug("removing shm " + shm);
  }
  // Stop tracking the shmId.
  RegisteredShm removedShm = segments.remove(shm.getShmId());
  Preconditions.checkState(removedShm == shm,
      "failed to remove " + shm.getShmId());
  // Stop tracking the slots.
  for (Iterator<Slot> iter = shm.slotIterator(); iter.hasNext(); ) {
    Slot slot = iter.next();
    boolean removed = slots.remove(slot.getBlockId(), slot);
    Preconditions.checkState(removed);
    slot.makeInvalid();
  }
  // De-allocate the memory map and close the shared file. 
  shm.free();
}
项目:big-c    文件:ShortCircuitRegistry.java   
public synchronized void removeShm(ShortCircuitShm shm) {
  if (LOG.isTraceEnabled()) {
    LOG.debug("removing shm " + shm);
  }
  // Stop tracking the shmId.
  RegisteredShm removedShm = segments.remove(shm.getShmId());
  Preconditions.checkState(removedShm == shm,
      "failed to remove " + shm.getShmId());
  // Stop tracking the slots.
  for (Iterator<Slot> iter = shm.slotIterator(); iter.hasNext(); ) {
    Slot slot = iter.next();
    boolean removed = slots.remove(slot.getBlockId(), slot);
    Preconditions.checkState(removed);
    slot.makeInvalid();
  }
  // De-allocate the memory map and close the shared file. 
  shm.free();
}
项目:hadoop-2.6.0-cdh5.4.3    文件:ShortCircuitRegistry.java   
public synchronized void removeShm(ShortCircuitShm shm) {
  if (LOG.isTraceEnabled()) {
    LOG.debug("removing shm " + shm);
  }
  // Stop tracking the shmId.
  RegisteredShm removedShm = segments.remove(shm.getShmId());
  Preconditions.checkState(removedShm == shm,
      "failed to remove " + shm.getShmId());
  // Stop tracking the slots.
  for (Iterator<Slot> iter = shm.slotIterator(); iter.hasNext(); ) {
    Slot slot = iter.next();
    boolean removed = slots.remove(slot.getBlockId(), slot);
    Preconditions.checkState(removed);
    slot.makeInvalid();
  }
  // De-allocate the memory map and close the shared file. 
  shm.free();
}
项目:FlexMap    文件:ShortCircuitRegistry.java   
public synchronized void removeShm(ShortCircuitShm shm) {
  if (LOG.isTraceEnabled()) {
    LOG.debug("removing shm " + shm);
  }
  // Stop tracking the shmId.
  RegisteredShm removedShm = segments.remove(shm.getShmId());
  Preconditions.checkState(removedShm == shm,
      "failed to remove " + shm.getShmId());
  // Stop tracking the slots.
  for (Iterator<Slot> iter = shm.slotIterator(); iter.hasNext(); ) {
    Slot slot = iter.next();
    boolean removed = slots.remove(slot.getBlockId(), slot);
    Preconditions.checkState(removed);
    slot.makeInvalid();
  }
  // De-allocate the memory map and close the shared file. 
  shm.free();
}
项目:hadoop    文件:TestShortCircuitShm.java   
@Test(timeout=60000)
public void testStartupShutdown() throws Exception {
  File path = new File(TEST_BASE, "testStartupShutdown");
  path.mkdirs();
  SharedFileDescriptorFactory factory =
      SharedFileDescriptorFactory.create("shm_",
          new String[] { path.getAbsolutePath() } );
  FileInputStream stream =
      factory.createDescriptor("testStartupShutdown", 4096);
  ShortCircuitShm shm = new ShortCircuitShm(ShmId.createRandom(), stream);
  shm.free();
  stream.close();
  FileUtil.fullyDelete(path);
}
项目:hadoop    文件:BlockReaderTestUtil.java   
public static void enableShortCircuitShmTracing() {
  LogManager.getLogger(DfsClientShmManager.class.getName()).setLevel(
      Level.TRACE);
  LogManager.getLogger(ShortCircuitRegistry.class.getName()).setLevel(
      Level.TRACE);
  LogManager.getLogger(ShortCircuitShm.class.getName()).setLevel(
      Level.TRACE);
  LogManager.getLogger(DataNode.class.getName()).setLevel(
      Level.TRACE);
}
项目:aliyun-oss-hadoop-fs    文件:BlockReaderTestUtil.java   
public static void enableShortCircuitShmTracing() {
  LogManager.getLogger(DfsClientShmManager.class.getName()).setLevel(
      Level.TRACE);
  LogManager.getLogger(ShortCircuitRegistry.class.getName()).setLevel(
      Level.TRACE);
  LogManager.getLogger(ShortCircuitShm.class.getName()).setLevel(
      Level.TRACE);
  LogManager.getLogger(DataNode.class.getName()).setLevel(
      Level.TRACE);
}
项目:big-c    文件:TestShortCircuitShm.java   
@Test(timeout=60000)
public void testStartupShutdown() throws Exception {
  File path = new File(TEST_BASE, "testStartupShutdown");
  path.mkdirs();
  SharedFileDescriptorFactory factory =
      SharedFileDescriptorFactory.create("shm_",
          new String[] { path.getAbsolutePath() } );
  FileInputStream stream =
      factory.createDescriptor("testStartupShutdown", 4096);
  ShortCircuitShm shm = new ShortCircuitShm(ShmId.createRandom(), stream);
  shm.free();
  stream.close();
  FileUtil.fullyDelete(path);
}
项目:big-c    文件:BlockReaderTestUtil.java   
public static void enableShortCircuitShmTracing() {
  LogManager.getLogger(DfsClientShmManager.class.getName()).setLevel(
      Level.TRACE);
  LogManager.getLogger(ShortCircuitRegistry.class.getName()).setLevel(
      Level.TRACE);
  LogManager.getLogger(ShortCircuitShm.class.getName()).setLevel(
      Level.TRACE);
  LogManager.getLogger(DataNode.class.getName()).setLevel(
      Level.TRACE);
}
项目:hadoop-2.6.0-cdh5.4.3    文件:TestShortCircuitShm.java   
@Test(timeout=60000)
public void testStartupShutdown() throws Exception {
  File path = new File(TEST_BASE, "testStartupShutdown");
  path.mkdirs();
  SharedFileDescriptorFactory factory =
      SharedFileDescriptorFactory.create("shm_",
          new String[] { path.getAbsolutePath() } );
  FileInputStream stream =
      factory.createDescriptor("testStartupShutdown", 4096);
  ShortCircuitShm shm = new ShortCircuitShm(ShmId.createRandom(), stream);
  shm.free();
  stream.close();
  FileUtil.fullyDelete(path);
}
项目:hadoop-2.6.0-cdh5.4.3    文件:BlockReaderTestUtil.java   
public static void enableShortCircuitShmTracing() {
  LogManager.getLogger(DfsClientShmManager.class.getName()).setLevel(
      Level.TRACE);
  LogManager.getLogger(ShortCircuitRegistry.class.getName()).setLevel(
      Level.TRACE);
  LogManager.getLogger(ShortCircuitShm.class.getName()).setLevel(
      Level.TRACE);
  LogManager.getLogger(DataNode.class.getName()).setLevel(
      Level.TRACE);
}
项目:FlexMap    文件:TestShortCircuitShm.java   
@Test(timeout=60000)
public void testStartupShutdown() throws Exception {
  File path = new File(TEST_BASE, "testStartupShutdown");
  path.mkdirs();
  SharedFileDescriptorFactory factory =
      SharedFileDescriptorFactory.create("shm_",
          new String[] { path.getAbsolutePath() } );
  FileInputStream stream =
      factory.createDescriptor("testStartupShutdown", 4096);
  ShortCircuitShm shm = new ShortCircuitShm(ShmId.createRandom(), stream);
  shm.free();
  stream.close();
  FileUtil.fullyDelete(path);
}
项目:FlexMap    文件:BlockReaderTestUtil.java   
public static void enableShortCircuitShmTracing() {
  LogManager.getLogger(DfsClientShmManager.class.getName()).setLevel(
      Level.TRACE);
  LogManager.getLogger(ShortCircuitRegistry.class.getName()).setLevel(
      Level.TRACE);
  LogManager.getLogger(ShortCircuitShm.class.getName()).setLevel(
      Level.TRACE);
  LogManager.getLogger(DataNode.class.getName()).setLevel(
      Level.TRACE);
}