Java 类org.apache.lucene.util.WeakIdentityMap 实例源码

项目:lams    文件:ByteBufferIndexInput.java   
public static ByteBufferIndexInput newInstance(String resourceDescription, ByteBuffer[] buffers, long length, int chunkSizePower, BufferCleaner cleaner, boolean trackClones) {
  final WeakIdentityMap<ByteBufferIndexInput,Boolean> clones = trackClones ? WeakIdentityMap.<ByteBufferIndexInput,Boolean>newConcurrentHashMap() : null;
  if (buffers.length == 1) {
    return new SingleBufferImpl(resourceDescription, buffers[0], length, chunkSizePower, cleaner, clones);
  } else {
    return new DefaultImpl(resourceDescription, buffers, length, chunkSizePower, cleaner, clones);
  }
}
项目:lams    文件:ByteBufferIndexInput.java   
ByteBufferIndexInput(String resourceDescription, ByteBuffer[] buffers, long length, int chunkSizePower, BufferCleaner cleaner, WeakIdentityMap<ByteBufferIndexInput,Boolean> clones) {
  super(resourceDescription);
  this.buffers = buffers;
  this.length = length;
  this.chunkSizePower = chunkSizePower;
  this.chunkSizeMask = (1L << chunkSizePower) - 1L;
  this.clones = clones;
  this.cleaner = cleaner;
  assert chunkSizePower >= 0 && chunkSizePower <= 30;   
  assert (length >>> chunkSizePower) < Integer.MAX_VALUE;
}
项目:lams    文件:ByteBufferIndexInput.java   
DefaultImpl(String resourceDescription, ByteBuffer[] buffers, long length, int chunkSizePower, 
    BufferCleaner cleaner, WeakIdentityMap<ByteBufferIndexInput,Boolean> clones) {
  super(resourceDescription, buffers, length, chunkSizePower, cleaner, clones);
  try {
    seek(0L);
  } catch (IOException ioe) {
    throw new AssertionError(ioe);
  }
}
项目:lams    文件:ByteBufferIndexInput.java   
SingleBufferImpl(String resourceDescription, ByteBuffer buffer, long length, int chunkSizePower,
    BufferCleaner cleaner, WeakIdentityMap<ByteBufferIndexInput,Boolean> clones) {
  super(resourceDescription, new ByteBuffer[] { buffer }, length, chunkSizePower, cleaner, clones);
  this.curBufIndex = 0;
  this.curBuf = buffer;
  buffer.position(0);
}
项目:lams    文件:ByteBufferIndexInput.java   
WithOffsetImpl(String resourceDescription, ByteBuffer[] buffers, int offset, long length, int chunkSizePower,
    BufferCleaner cleaner, WeakIdentityMap<ByteBufferIndexInput,Boolean> clones) {
  super(resourceDescription, buffers, length, chunkSizePower, cleaner, clones);
  this.offset = offset;
  try {
    seek(0L);
  } catch (IOException ioe) {
    throw new AssertionError(ioe);
  }
}
项目:search    文件:ByteBufferIndexInput.java   
public static ByteBufferIndexInput newInstance(String resourceDescription, ByteBuffer[] buffers, long length, int chunkSizePower, BufferCleaner cleaner, boolean trackClones) {
  final WeakIdentityMap<ByteBufferIndexInput,Boolean> clones = trackClones ? WeakIdentityMap.<ByteBufferIndexInput,Boolean>newConcurrentHashMap() : null;
  if (buffers.length == 1) {
    return new SingleBufferImpl(resourceDescription, buffers[0], length, chunkSizePower, cleaner, clones);
  } else {
    return new DefaultImpl(resourceDescription, buffers, length, chunkSizePower, cleaner, clones);
  }
}
项目:search    文件:ByteBufferIndexInput.java   
ByteBufferIndexInput(String resourceDescription, ByteBuffer[] buffers, long length, int chunkSizePower, BufferCleaner cleaner, WeakIdentityMap<ByteBufferIndexInput,Boolean> clones) {
  super(resourceDescription);
  this.buffers = buffers;
  this.length = length;
  this.chunkSizePower = chunkSizePower;
  this.chunkSizeMask = (1L << chunkSizePower) - 1L;
  this.clones = clones;
  this.cleaner = cleaner;
  assert chunkSizePower >= 0 && chunkSizePower <= 30;   
  assert (length >>> chunkSizePower) < Integer.MAX_VALUE;
}
项目:search    文件:ByteBufferIndexInput.java   
DefaultImpl(String resourceDescription, ByteBuffer[] buffers, long length, int chunkSizePower, 
    BufferCleaner cleaner, WeakIdentityMap<ByteBufferIndexInput,Boolean> clones) {
  super(resourceDescription, buffers, length, chunkSizePower, cleaner, clones);
  try {
    seek(0L);
  } catch (IOException ioe) {
    throw new AssertionError(ioe);
  }
}
项目:search    文件:ByteBufferIndexInput.java   
SingleBufferImpl(String resourceDescription, ByteBuffer buffer, long length, int chunkSizePower,
    BufferCleaner cleaner, WeakIdentityMap<ByteBufferIndexInput,Boolean> clones) {
  super(resourceDescription, new ByteBuffer[] { buffer }, length, chunkSizePower, cleaner, clones);
  this.curBufIndex = 0;
  this.curBuf = buffer;
  buffer.position(0);
}
项目:search    文件:ByteBufferIndexInput.java   
WithOffsetImpl(String resourceDescription, ByteBuffer[] buffers, int offset, long length, int chunkSizePower,
    BufferCleaner cleaner, WeakIdentityMap<ByteBufferIndexInput,Boolean> clones) {
  super(resourceDescription, buffers, length, chunkSizePower, cleaner, clones);
  this.offset = offset;
  try {
    seek(0L);
  } catch (IOException ioe) {
    throw new AssertionError(ioe);
  }
}
项目:read-open-source-code    文件:ByteBufferIndexInput.java   
public static ByteBufferIndexInput newInstance(String resourceDescription, ByteBuffer[] buffers, long length, int chunkSizePower, BufferCleaner cleaner, boolean trackClones) {
  final WeakIdentityMap<ByteBufferIndexInput,Boolean> clones = trackClones ? WeakIdentityMap.<ByteBufferIndexInput,Boolean>newConcurrentHashMap() : null;
  if (buffers.length == 1) {
    return new SingleBufferImpl(resourceDescription, buffers[0], length, chunkSizePower, cleaner, clones);
  } else {
    return new DefaultImpl(resourceDescription, buffers, length, chunkSizePower, cleaner, clones);
  }
}
项目:read-open-source-code    文件:ByteBufferIndexInput.java   
ByteBufferIndexInput(String resourceDescription, ByteBuffer[] buffers, long length, int chunkSizePower, BufferCleaner cleaner, WeakIdentityMap<ByteBufferIndexInput,Boolean> clones) {
  super(resourceDescription);
  this.buffers = buffers;
  this.length = length;
  this.chunkSizePower = chunkSizePower;
  this.chunkSizeMask = (1L << chunkSizePower) - 1L;
  this.clones = clones;
  this.cleaner = cleaner;
  assert chunkSizePower >= 0 && chunkSizePower <= 30;   
  assert (length >>> chunkSizePower) < Integer.MAX_VALUE;
}
项目:read-open-source-code    文件:ByteBufferIndexInput.java   
DefaultImpl(String resourceDescription, ByteBuffer[] buffers, long length, int chunkSizePower, 
    BufferCleaner cleaner, WeakIdentityMap<ByteBufferIndexInput,Boolean> clones) {
  super(resourceDescription, buffers, length, chunkSizePower, cleaner, clones);
  try {
    seek(0L);
  } catch (IOException ioe) {
    throw new AssertionError(ioe);
  }
}
项目:read-open-source-code    文件:ByteBufferIndexInput.java   
SingleBufferImpl(String resourceDescription, ByteBuffer buffer, long length, int chunkSizePower,
    BufferCleaner cleaner, WeakIdentityMap<ByteBufferIndexInput,Boolean> clones) {
  super(resourceDescription, new ByteBuffer[] { buffer }, length, chunkSizePower, cleaner, clones);
  this.curBufIndex = 0;
  this.curBuf = buffer;
  buffer.position(0);
}
项目:read-open-source-code    文件:ByteBufferIndexInput.java   
WithOffsetImpl(String resourceDescription, ByteBuffer[] buffers, int offset, long length, int chunkSizePower,
    BufferCleaner cleaner, WeakIdentityMap<ByteBufferIndexInput,Boolean> clones) {
  super(resourceDescription, buffers, length, chunkSizePower, cleaner, clones);
  this.offset = offset;
  try {
    seek(0L);
  } catch (IOException ioe) {
    throw new AssertionError(ioe);
  }
}