示例#1
0
 /** Notify the coordinator that this site has received the first fragment message */
 private void sendFirstFragResponse() {
   if (JOINLOG.isDebugEnabled()) {
     JOINLOG.debug(
         "P"
             + m_partitionId
             + " sending first fragment response to coordinator "
             + CoreUtils.hsIdToString(m_coordinatorHsId));
   }
   RejoinMessage msg =
       new RejoinMessage(m_mailbox.getHSId(), RejoinMessage.Type.FIRST_FRAGMENT_RECEIVED);
   m_mailbox.send(m_coordinatorHsId, msg);
   m_firstFragResponseSent = true;
 }
示例#2
0
 /**
  * By default returns HashinatorType.LEGACY, but for development another hashinator can be
  * specified using the environment variable or the Java property HASHINATOR
  */
 public static HashinatorType getConfiguredHashinatorType() {
   if (configuredHashinatorType != null) {
     return configuredHashinatorType;
   }
   String hashinatorType = System.getenv("HASHINATOR");
   if (hashinatorType == null) {
     hashinatorType = System.getProperty("HASHINATOR", HashinatorType.LEGACY.name());
   }
   if (hostLogger.isDebugEnabled()) {
     hostLogger.debug("Overriding hashinator to use " + hashinatorType);
   }
   configuredHashinatorType = HashinatorType.valueOf(hashinatorType.trim().toUpperCase());
   return configuredHashinatorType;
 }
示例#3
0
  // produce the contents of the repair log.
  public List<Iv2RepairLogResponseMessage> contents(long requestId, boolean forMPI) {
    List<Item> items = new LinkedList<Item>();
    // All cases include the log of MP transactions
    items.addAll(m_logMP);
    // SP repair requests also want the SP transactions
    if (!forMPI) {
      items.addAll(m_logSP);
    }

    // Contents need to be sorted in increasing spHandle order
    Collections.sort(items, m_handleComparator);

    int ofTotal = items.size() + 1;
    if (tmLog.isDebugEnabled()) {
      tmLog.debug("Responding with " + ofTotal + " repair log parts.");
    }
    List<Iv2RepairLogResponseMessage> responses = new LinkedList<Iv2RepairLogResponseMessage>();

    // this constructor sets its sequence no to 0 as ack
    // messages are first in the sequence
    Iv2RepairLogResponseMessage hheader =
        new Iv2RepairLogResponseMessage(
            requestId,
            ofTotal,
            m_lastSpHandle,
            m_lastMpHandle,
            TheHashinator.getCurrentVersionedConfigCooked());
    responses.add(hheader);

    int seq = responses.size(); // = 1, as the first sequence

    Iterator<Item> itemator = items.iterator();
    while (itemator.hasNext()) {
      Item item = itemator.next();
      Iv2RepairLogResponseMessage response =
          new Iv2RepairLogResponseMessage(
              requestId, seq++, ofTotal, item.getHandle(), item.getTxnId(), item.getMessage());
      responses.add(response);
    }
    return responses;
  }