Examples of KUID


Examples of org.ardverk.dht.KUID

    long now = System.currentTimeMillis();
   
    Date tombstone = new Date(now);
    Timestamp modified = new Timestamp(now);
   
    KUID bucketId = key.getId();
    KUID keyId = KeyId.valueOf(key);
   
    boolean success = true;
   
    try {
      cm.beginTxn();
View Full Code Here

Examples of org.ardverk.dht.KUID

  public boolean remove(Key key, KUID valueId) throws SQLException {
   
    long now = System.currentTimeMillis();
    Timestamp modified = new Timestamp(now);
   
    KUID bucketId = key.getId();
    KUID keyId = KeyId.valueOf(key);
   
    boolean success = true;
   
    try {
      cm.beginTxn();
View Full Code Here

Examples of org.ardverk.dht.KUID

 
  public PainterPanel(DHT dht) {
    this.dht = dht;
   
    Contact localhost = dht.getIdentity();
    KUID localhostId = localhost.getId();
   
    painters.add(new JuicePainter(localhostId));
    painters.add(new SquashPainter(localhostId));
   
    addMouseListener(new MouseAdapter() {
View Full Code Here

Examples of org.ardverk.dht.KUID

    throw new IOException();
  }
 
  protected boolean messageSent(RequestMessage request,
      ResponseMessage response) {
    KUID contactId = request.getContact().getId();
    return messageSent(contactId, response);
  }
View Full Code Here

Examples of org.ardverk.dht.KUID

      }
     
      private void handleRequest(RequestMessage request) throws IOException {
        ResponseMessage response = DatagramTransport.this.handleRequest(request);
        if (response != null) {
          KUID contactId = request.getContact().getId();
          send(contactId, response, -1L, TimeUnit.MILLISECONDS);
        }
      }
     
      private boolean handleResponse(ResponseMessage response) throws IOException {
View Full Code Here

Examples of org.ardverk.dht.KUID

public class DatastoreUtils {

  private DatastoreUtils() {}
 
  public static boolean isInBucket(Key key, RouteTable routeTable) {
    KUID bucketId = key.getId();
    Contact[] contacts = routeTable.select(bucketId);
    Contact localhost = routeTable.getIdentity();
   
    if (!ArrayUtils.contains(localhost, contacts)) {
      return false;
View Full Code Here

Examples of org.ardverk.dht.KUID

   * Sends a {@link RequestMessage} to the given {@link Contact}.
   */
  public void send(Contact dst, RequestMessage message,
      long timeout, TimeUnit unit) throws IOException {
   
    KUID contactId = dst.getId();
    send(contactId, message, timeout, unit);
  }
View Full Code Here

Examples of org.ardverk.dht.KUID

    //   intermediate array as a cache and we're sorting the cache
    //   array instead.
    @SuppressWarnings("unchecked")
    ValueRef<T>[] valueRefs = new ValueRef[values.length];
   
    KUID id = key.getId();
    for (int i = values.length-1; i >= 0; --i) {
      valueRefs[i] = new ValueRef<T>(values[i], id);
    }
   
    Arrays.sort(valueRefs, ascending ? XOR_ASCENDING : XOR_DESCENDING);
View Full Code Here

Examples of org.ardverk.dht.KUID

    if (contactId == null) {
      return (response instanceof PingResponse);
    }
   
    Contact contact = response.getContact();
    KUID otherId = contact.getId();
   
    return contactId.equals(otherId);
  }
View Full Code Here

Examples of org.ardverk.dht.KUID

   * Initializes the {@link DefaultRouteTable}.
   */
  private synchronized void init() {
    consecutiveErrors = 0;
   
    KUID contactId = localhost.getId();
    KUID bucketId = contactId.min();
   
    DefaultBucket bucket = new DefaultBucket(bucketId, 0);
    buckets.put(bucketId, bucket);
   
    add0(localhost);
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.