Package org.apache.hadoop.hdfs.notifier

Examples of org.apache.hadoop.hdfs.notifier.TransactionIdTooOldException$TransactionIdTooOldExceptionTupleScheme


    public void addNotificationsToQueue(NamespaceEvent event, long txId,
        Queue<NamespaceNotification> notifications)
        throws TransactionIdTooOldException {
      // Using -2 to mark a transaction which is too old
      if (txId == -2)
        throw new TransactionIdTooOldException();
     
      // Using -3 to mark we should add these 2 notifications
      if (txId == -3) {
        notifications.add(new NamespaceNotification("/a/b",
            EventType.FILE_ADDED.getByteValue(), 20));
View Full Code Here


    }
   
    historyLock.readLock().lock();
    try {
      if (orderedHistoryList == null || orderedHistoryList.size() == 0) {
        throw new TransactionIdTooOldException("No data in history.");
      }
     
      if (orderedHistoryList.get(0).txnId > txId ||
          orderedHistoryList.get(orderedHistoryList.size() - 1).txnId < txId) {
        throw new TransactionIdTooOldException("No data in history for txId " + txId);
      }
     
      int index = Collections.binarySearch(orderedHistoryList, new HistoryTreeEntry(0, txId, event.type),
            comparatorByID);
     
      if (index < 0) {
        // If we got here, there are 2 possibilities:
        // * The client gave us a bad transaction id.
        // * We missed one (or more) transaction(s)
        LOG.error("Potential corrupt history. Got request for: " +
            NotifierUtils.asString(event) + " and txId: " + txId);
        throw new TransactionIdTooOldException(
            "Potentially corrupt server history");
      }
     
      String dirFormatPath = event.path;
      if (!dirFormatPath.endsWith(Path.SEPARATOR)) {
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hdfs.notifier.TransactionIdTooOldException$TransactionIdTooOldExceptionTupleScheme

Copyright © 2018 www.massapicom. 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.