Examples of ByteArrayWrapper


Examples of freenet.support.ByteArrayWrapper

    return -1;
  }
 
  @Override
  public boolean probablyInStore(byte[] routingKey) {
    ByteArrayWrapper key = new ByteArrayWrapper(routingKey);
    return blocksByRoutingKey.get(key) != null;
  }
View Full Code Here

Examples of freenet.support.ByteArrayWrapper

  }

  public void migrateTo(StoreCallback<T> target, boolean canReadClientCache) throws IOException {
    Enumeration<ByteArrayWrapper> keys = blocksByRoutingKey.keys();
    while(keys.hasMoreElements()) {
      ByteArrayWrapper routingKeyWrapped = keys.nextElement();
      byte[] routingKey = routingKeyWrapped.get();
      Block block = blocksByRoutingKey.get(routingKeyWrapped);
     
      T ret;
      try {
        ret = callback.construct(block.data, block.header, routingKey, block.fullKey, canReadClientCache, false, null, null);
View Full Code Here

Examples of freenet.support.ByteArrayWrapper

  /**
   * @param meta IGNORED!
   */
  @Override
  public T fetch(byte[] routingKey, byte[] fullKey, boolean dontPromote, boolean canReadClientCache, boolean canReadSlashdotCache, boolean ignoreOldBlocks, BlockMetadata meta) throws IOException {
    ByteArrayWrapper key = new ByteArrayWrapper(routingKey);
    DiskBlock block;
    long timeAccessed;
    synchronized(this) {
      block = blocksByRoutingKey.get(key);
      if(block == null) {
View Full Code Here

Examples of freenet.support.ByteArrayWrapper

    return misses;
  }

  @Override
  public boolean probablyInStore(byte[] routingKey) {
    ByteArrayWrapper key = new ByteArrayWrapper(routingKey);
    return blocksByRoutingKey.containsKey(key);
  }
View Full Code Here

Examples of freenet.support.ByteArrayWrapper

    os.close();
    }
   
    DiskBlock stored = new DiskBlock();
    stored.data = bucket;
    purgeOldData(new ByteArrayWrapper(routingkey), stored);
  }
View Full Code Here

Examples of freenet.support.ByteArrayWrapper

    HashMap<ByteArrayWrapper, DSAPublicKey> map = new HashMap<ByteArrayWrapper, DSAPublicKey>();
    for(int i=0;i<keys;i++) {
      DSAPrivateKey privKey = new DSAPrivateKey(group, random);
      DSAPublicKey key = new DSAPublicKey(group, privKey);
      byte[] hash = key.asBytesHash();
      ByteArrayWrapper w = new ByteArrayWrapper(hash);
      map.put(w, key.cloneKey());
      pk.put(hash, key, false);
      assertTrue(pk.fetch(hash, false, false, null).equals(key));
    }
    int x = 0;
View Full Code Here

Examples of freenet.support.ByteArrayWrapper

    HashMap<ByteArrayWrapper, DSAPublicKey> map = new HashMap<ByteArrayWrapper, DSAPublicKey>();
    for(int i=0;i<keys;i++) {
      DSAPrivateKey privKey = new DSAPrivateKey(group, random);
      DSAPublicKey key = new DSAPublicKey(group, privKey);
      byte[] hash = key.asBytesHash();
      ByteArrayWrapper w = new ByteArrayWrapper(hash);
      map.put(w, key.cloneKey());
      pubkeys.cacheKey(hash, key, false, false, false, false, false);
      assertTrue(pubkeys.getKey(hash, false, false, null).equals(key));
    }
    int x = 0;
View Full Code Here

Examples of freenet.support.ByteArrayWrapper

   *
   * @param plainKey
   * @return
   */
  byte[] getDigestedKey(byte[] plainKey) {
    ByteArrayWrapper key = new ByteArrayWrapper(plainKey);
    synchronized (digestRoutingKeyCache) {
      byte[] dk = digestRoutingKeyCache.get(key);
      if (dk != null)
        return dk;
    }
View Full Code Here

Examples of freenet.support.ByteArrayWrapper

  @Override
  public T fetch(byte[] routingKey, byte[] fullKey,
      boolean dontPromote, boolean canReadClientCache,
      boolean canReadSlashdotCache, boolean ignoreOldBlocks, BlockMetadata meta)
      throws IOException {
    ByteArrayWrapper key = new ByteArrayWrapper(routingKey);
   
    Block<T> block = null;
   
    configLock.readLock().lock();
    try {
View Full Code Here

Examples of freenet.support.ByteArrayWrapper

    return backDatastore.misses();
  }

  @Override
  public boolean probablyInStore(byte[] routingKey) {
    ByteArrayWrapper key = new ByteArrayWrapper(routingKey);
    Block<T> block = null;
   
    configLock.readLock().lock();
    try {
      block = blocksByRoutingKey.get(key);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.