Пример #1
0
 void printView() {
   System.out.println("\n-- view: " + channel.getView() + '\n');
   try {
     System.in.skip(System.in.available());
   } catch (Exception e) {
   }
 }
Пример #2
0
 void setAnycastCount() throws Exception {
   int tmp = Util.readIntFromStdin("Anycast count: ");
   View view = channel.getView();
   if (tmp > view.size()) {
     System.err.println(
         "anycast count must be smaller or equal to the view size (" + view + ")\n");
     return;
   }
   disp.callRemoteMethods(null, new MethodCall(SET_ANYCAST_COUNT, tmp), RequestOptions.SYNC());
 }
Пример #3
0
 /** Picks the next member in the view */
 private Address getReceiver() {
   try {
     List<Address> mbrs = channel.getView().getMembers();
     int index = mbrs.indexOf(local_addr);
     int new_index = index + 1 % mbrs.size();
     return mbrs.get(new_index);
   } catch (Exception e) {
     System.err.println("UPerf.getReceiver(): " + e);
     return null;
   }
 }