当前位置: 首页>>代码示例>>Java>>正文


Java Slot.makeInvalid方法代码示例

本文整理汇总了Java中org.apache.hadoop.hdfs.shortcircuit.ShortCircuitShm.Slot.makeInvalid方法的典型用法代码示例。如果您正苦于以下问题:Java Slot.makeInvalid方法的具体用法?Java Slot.makeInvalid怎么用?Java Slot.makeInvalid使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.hadoop.hdfs.shortcircuit.ShortCircuitShm.Slot的用法示例。

在下文中一共展示了Slot.makeInvalid方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: removeShm

import org.apache.hadoop.hdfs.shortcircuit.ShortCircuitShm.Slot; //导入方法依赖的package包/类
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();
}
 
开发者ID:naver,项目名称:hadoop,代码行数:19,代码来源:ShortCircuitRegistry.java


示例2: processBlockInvalidation

import org.apache.hadoop.hdfs.shortcircuit.ShortCircuitShm.Slot; //导入方法依赖的package包/类
/**
 * Invalidate any slot associated with a blockId that we are invalidating
 * (deleting) from this DataNode.  When a slot is invalid, the DFSClient will
 * not use the corresponding replica for new read or mmap operations (although
 * existing, ongoing read or mmap operations will complete.)
 *
 * @param blockId        The block ID.
 */
public synchronized void processBlockInvalidation(ExtendedBlockId blockId) {
  if (!enabled) return;
  final Set<Slot> affectedSlots = slots.get(blockId);
  if (!affectedSlots.isEmpty()) {
    final StringBuilder bld = new StringBuilder();
    String prefix = "";
    bld.append("Block ").append(blockId).append(" has been invalidated.  ").
        append("Marking short-circuit slots as invalid: ");
    for (Slot slot : affectedSlots) {
      slot.makeInvalid();
      bld.append(prefix).append(slot.toString());
      prefix = ", ";
    }
    LOG.info(bld.toString());
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:25,代码来源:ShortCircuitRegistry.java


示例3: unregisterSlot

import org.apache.hadoop.hdfs.shortcircuit.ShortCircuitShm.Slot; //导入方法依赖的package包/类
public synchronized void unregisterSlot(SlotId slotId)
    throws InvalidRequestException {
  if (!enabled) {
    if (LOG.isTraceEnabled()) {
      LOG.trace("unregisterSlot: ShortCircuitRegistry is " +
          "not enabled.");
    }
    throw new UnsupportedOperationException();
  }
  ShmId shmId = slotId.getShmId();
  RegisteredShm shm = segments.get(shmId);
  if (shm == null) {
    throw new InvalidRequestException("there is no shared memory segment " +
        "registered with shmId " + shmId);
  }
  Slot slot = shm.getSlot(slotId.getSlotIdx());
  slot.makeInvalid();
  shm.unregisterSlot(slotId.getSlotIdx());
  slots.remove(slot.getBlockId(), slot);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:21,代码来源:ShortCircuitRegistry.java


示例4: freeSlot

import org.apache.hadoop.hdfs.shortcircuit.ShortCircuitShm.Slot; //导入方法依赖的package包/类
/**
 * Free a slot immediately.
 *
 * ONLY use this if the DataNode is not yet aware of the slot.
 * 
 * @param slot           The slot to free.
 */
public void freeSlot(Slot slot) {
  Preconditions.checkState(shmManager != null);
  slot.makeInvalid();
  shmManager.freeSlot(slot);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:13,代码来源:ShortCircuitCache.java


示例5: freeSlot

import org.apache.hadoop.hdfs.shortcircuit.ShortCircuitShm.Slot; //导入方法依赖的package包/类
/**
 * Free a slot immediately.
 *
 * ONLY use this if the DataNode is not yet aware of the slot.
 *
 * @param slot           The slot to free.
 */
public void freeSlot(Slot slot) {
  Preconditions.checkState(shmManager != null);
  slot.makeInvalid();
  shmManager.freeSlot(slot);
}
 
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:13,代码来源:ShortCircuitCache.java



注:本文中的org.apache.hadoop.hdfs.shortcircuit.ShortCircuitShm.Slot.makeInvalid方法示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。