Example #1
0
File: walk.C Project: Amit-DU/dht
void
getsucc (const chord_node &n)
{
  chord_nodelistextres *res = New chord_nodelistextres ();
  doRPC (n, chord_program_1, succproc, &n.x, res,
	 wrap (&getsucc_cb, getusec (), n, res));
}
Example #2
0
//----- update predecessor -------------------------------------------------
void
update_pred (f_node *nu)
{
  chordID n = nu->ID;
  chord_nodelistextres *res = New chord_nodelistextres ();
  doRPC (nu, chord_program_1, CHORDPROC_GETPRED_EXT, &n, res,
	 wrap (&update_pred_got_pred,
	       nu->ID, nu->host, nu->port, res));
}
Example #3
0
void
update_succlist (f_node *nu)
{
  chordID n = nu->ID;
  chord_nodelistextres *res = New chord_nodelistextres ();
  doRPC (nu, chord_program_1, CHORDPROC_GETSUCC_EXT, &n, res,
	 wrap (&update_succ_got_succ, 
	       nu->ID, nu->host, nu->port, res));
}
Example #4
0
void
getsucc (const chord_node &n)
{
  chord_nodelistextres *res = New chord_nodelistextres ();
  u_int64_t start = getusec ();

  doRPC (n, CHORDPROC_GETSUCC_EXT, &n.x, res,
	 wrap (&getsucc_cb, n.x, n.r.hostname, res, start));
}
Example #5
0
File: nodeq.C Project: Amit-DU/dht
void
print_predecessors (const chord_node &dst)
{
  ptr<chordID> ga = New refcounted<chordID> (dst.x);
  chord_nodelistextres *lst = New chord_nodelistextres ();
  doRPC (dst, chord_program_1, CHORDPROC_GETPRED_EXT,
	 ga, lst,
	 wrap (processreslist_cb, "predecessors", &predecessors, lst));
  outstanding++;
}
Example #6
0
//----- update fingers -----------------------------------------------------
void
update_fingers (f_node *nu)
{
  chordID n = nu->ID;
  chord_nodelistextres *res = New chord_nodelistextres ();
  if (accordion) 
    doRPC (nu, accordion_program_1, ACCORDIONPROC_GETFINGERS_EXT, &n, res,
	 wrap (&update_fingers_got_fingers, 
	       nu->ID, nu->host, nu->port, res));
   else 
    doRPC (nu, fingers_program_1, FINGERSPROC_GETFINGERS_EXT, &n, res,
	 wrap (&update_fingers_got_fingers, 
	       nu->ID, nu->host, nu->port, res));
}
Example #7
0
File: nodeq.C Project: Amit-DU/dht
void
print_fingers (const chord_node &dst)
{
  ptr<chordID> ga = New refcounted<chordID> (dst.x);
  chord_nodelistextres *lst = New chord_nodelistextres ();
  if (do_accordion) 
    doRPC (dst, accordion_program_1, ACCORDIONPROC_GETFINGERS_EXT,
	 ga, lst,
	 wrap (processreslist_cb, "fingers", &fingers, lst));
  else 
    doRPC (dst, fingers_program_1, FINGERSPROC_GETFINGERS_EXT,
	 ga, lst,
	 wrap (processreslist_cb, "fingers", &fingers, lst));
  outstanding++;
}