Received ACK for file at {@code sequenceNumber}.

@param sequenceNumber sequence number of file
765738
public void complete(int sequenceNumber)
    {
        boolean signalComplete;
        synchronized (this)
        {
            ScheduledFuture timeout = timeoutTasks.remove(sequenceNumber);
            if (timeout != null)
                timeout.cancel(false);

            OutgoingFileMessage file = files.remove(sequenceNumber);
            if (file != null)
                file.ref.release();

            signalComplete = files.isEmpty();
        }

        // all file sent, notify session this task is complete.
        if (signalComplete)
            session.taskCompleted(this);
    }
931328
public static boolean isNonAmbNucleotideSequence(String sequence) {
	sequence = SequenceUtil.cleanSequence(sequence);
	if (SequenceUtil.DIGIT.matcher(sequence).find()) {
		return false;
	}
	if (SequenceUtil.NON_NUCLEOTIDE.matcher(sequence).find()) {
		return false;
		/*
		 * System.out.format("I found the text starting at " +
		 * "index %d and ending at index %d.%n", nonDNAmatcher .start(),
		 * nonDNAmatcher.end());
		 */
	}
	final Matcher DNAmatcher = SequenceUtil.NUCLEOTIDE.matcher(sequence);
	return DNAmatcher.find();
	}
1334430
int nextSequenceShuffleIndex() throws Exception {
		RTObject popEvaluationStack = state.popEvaluationStack();

		IntValue numElementsIntVal = popEvaluationStack instanceof IntValue ? (IntValue) popEvaluationStack : null;

		if (numElementsIntVal == null) {
			error("expected number of elements in sequence for shuffle index");
			return 0;
		}

		Container seqContainer = state.getCurrentPointer().container;

		int numElements = numElementsIntVal.value;

		IntValue seqCountVal = (IntValue) state.popEvaluationStack();
		int seqCount = seqCountVal.value;
		int loopIndex = seqCount / numElements;
		int iterationIndex = seqCount % numElements;

		// Generate the same shuffle based on:
		// - The hash of this container, to make sure it's consistent
		// each time the runtime returns to the sequence
		// - How many times the runtime has looped around this full shuffle
		String seqPathStr = seqContainer.getPath().toString();
		int sequenceHash = 0;
		for (char c : seqPathStr.toCharArray()) {
			sequenceHash += c;
		}

		int randomSeed = sequenceHash + loopIndex + state.getStorySeed();

		Random random = new Random(randomSeed);

		ArrayList<Integer> unpickedIndices = new ArrayList<Integer>();
		for (int i = 0; i < numElements; ++i) {
			unpickedIndices.add(i);
		}

		for (int i = 0; i <= iterationIndex; ++i) {
			int chosen = random.nextInt(Integer.MAX_VALUE) % unpickedIndices.size();
			int chosenIndex = unpickedIndices.get(chosen);
			unpickedIndices.remove(chosen);

			if (i == iterationIndex) {
				return chosenIndex;
			}
		}

		throw new Exception("Should never reach here");
	}
1178789
public byte[] sendSubmitSmResp(OutputStream os, int sequenceNumber,
            String messageId) throws PDUStringException, IOException {
        return pduSender.sendSubmitSmResp(os, sequenceNumber, messageId);
    }
277154
@Override
	public AbstractSequence<AminoAcidCompound> getSequence(String sequence, long index) throws CompoundNotFoundException, IOException {
		SequenceFileProxyLoader<AminoAcidCompound> sequenceFileProxyLoader =
				new SequenceFileProxyLoader<AminoAcidCompound>(
						file,
						sequenceParser,
						index,
						sequence.length(),
						compoundSet
						);
		return new ProteinSequence(sequenceFileProxyLoader, compoundSet);
	}
456724
def seq(self):
        """"""

        if self.sequence_file:
            log.debug('{}: reading sequence from sequence file {}'.format(self.id, self.sequence_path))
            tmp_sr = SeqIO.read(self.sequence_path, 'fasta')
            return tmp_sr.seq

        elif self.metadata_file:
            log.debug('{}: reading sequence from metadata file {}'.format(self.id, self.metadata_path))
            tmp_sr = SeqIO.read(self.metadata_path, 'uniprot-xml')
            return tmp_sr.seq

        else:
            if not self._seq:
                log.debug('{}: no sequence stored in memory'.format(self.id))
            else:
                log.debug('{}: reading sequence from memory'.format(self.id))

            return self._seq
477039
public void registerSequenceQuery(long sequence, Runnable query) {
    // Add a query to be run once the session's sequence number reaches the given sequence number.
    List<Runnable> queries = this.sequenceQueries.computeIfAbsent(sequence, v -> new LinkedList<Runnable>());
    queries.add(query);
  }
1320567
private void writeSequenceBegin(int size) throws TException {
        getCurrentContext().write();
        if (getCurrentContext().isMapKey()) {
            throw new TException(SEQUENCE_AS_KEY_ILLEGAL);
        }
        pushContext(new SequenceContext(null));

        try {
            getCurrentWriter().writeStartArray();
        } catch (IOException ex) {
            throw new TTransportException(ex);
        }
    }
344820
@Override
    public long getLowestUncommittedSequenceNumber() {
        StorageOperation first = this.operations.getFirst();
        return first == null ? Operation.NO_SEQUENCE_NUMBER : first.getSequenceNumber();
    }
567920
@Override
	public T visitAnySequence(AnySequenceContext ctx) {
//		on(ctx);
		appendAst(ctx, tok(SEQUENCE));
		return super.visitAnySequence(ctx);
	}
1175545
public long getExpectedSequenceNumber()
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) 
      SibTr.entry(tc, "getExpectedSequenceNumber");
      
    long expectedSeqNumber = aoBrowserSession.getExpectedSequenceNumber();
    
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) 
      SibTr.exit(tc, "getExpectedSequenceNumber", new Long(expectedSeqNumber));
    return expectedSeqNumber;
  }
727975
private static long scanForSequence(final ImageInputStream pStream, final byte[] pSequence) throws IOException {
        long start = -1l;

        int index = 0;
        int nullBytes = 0;

        for (int read; (read = pStream.read()) >= 0;) {
            if (pSequence[index] == (byte) read) {
                // If this is the first byte in the sequence, store position
                if (start == -1) {
                    start = pStream.getStreamPosition() - 1;
                }

                // Inside the sequence, there might be 1 or 3 null bytes, depending on 16/32 byte encoding
                if (nullBytes == 1 || nullBytes == 3) {
                    pStream.skipBytes(nullBytes);
                }

                index++;

                // If we found the entire sequence, we're done, return start position
                if (index == pSequence.length) {
                    return start;
                }
            }
            else if (index == 1 && read == 0 && nullBytes < 3) {
                // Skip 1 or 3 null bytes for 16/32 bit encoding
                nullBytes++;
            }
            else if (index != 0) {
                // Start over
                index = 0;
                start = -1;
                nullBytes = 0;
            }
        }

        return -1l;
    }
795242
public void setProxySequenceReader(SequenceReader<C> proxyLoader) {
		this.sequenceStorage = proxyLoader;
		if (proxyLoader instanceof FeaturesKeyWordInterface) {
			this.setFeaturesKeyWord((FeaturesKeyWordInterface) sequenceStorage);
		}
		if (proxyLoader instanceof DatabaseReferenceInterface) {
			this.setDatabaseReferences((DatabaseReferenceInterface) sequenceStorage);
		}

		if (proxyLoader instanceof FeatureRetriever) {
			this.setFeatureRetriever((FeatureRetriever) sequenceStorage);
			HashMap<String, ArrayList<AbstractFeature>> ff = getFeatureRetriever().getFeatures();
			for (String k: ff.keySet()){
				for (AbstractFeature f: ff.get(k)){
					this.addFeature(f);
				}
			}
			// success of next statement guaranteed because source is a compulsory field
			//DBReferenceInfo dbQualifier = (DBReferenceInfo)ff.get("source").get(0).getQualifiers().get("db_xref");
			ArrayList<DBReferenceInfo> dbQualifiers = (ArrayList)ff.get("source").get(0).getQualifiers().get("db_xref");
			DBReferenceInfo dbQualifier = dbQualifiers.get(0);

			if (dbQualifier != null) this.setTaxonomy(new TaxonomyID(dbQualifier.getDatabase()+":"+dbQualifier.getId(), DataSource.UNKNOWN));
		}

		if(getAccession() == null && proxyLoader instanceof UniprotProxySequenceReader){ // we have lots of unsupported operations for this call so quick fix to allow this tow rork
			this.setAccession(proxyLoader.getAccession());
		}
	}
428132
protected static int findSequence(byte[] sequence, byte[] buffer) {
        int pos = -1;
        for (int i = 0; i < buffer.length - sequence.length + 1; i++) {
            if (buffer[i] == sequence[0] && testRemaining(sequence, buffer, i)) {
                pos = i;
                break;
            }
        }
        return pos;
    }
1193398
public void initNewList(int maxNumberOfTerms) throws IOException {
    if (closed) {
      result = null;
      closed = false;
    }
    if (segmentRegistration != null) {
      throw new IOException("missing segment name");
    } else {
      initNewListBasic(maxNumberOfTerms);
    }
  }
1043805
@Override
  public void onAccept()
  {
    if (_request != null) {
      System.out.println("OLD_REQUEST: " + _request);
    }
    
    _sequenceClose.set(-1);
    /*
    _request = protocol().newRequest(this);
    _request.onAccept();
    */
  }
167440
protected synchronized void incrFileFixReadBytesRemoteRack(long incr) {
    if (incr < 0) {
      throw new IllegalArgumentException("Cannot increment by negative value " +
                                         incr);
    }
    
    RaidNodeMetrics.getInstance(RaidNodeMetrics.DEFAULT_NAMESPACE_ID).numFileFixReadBytesRemoteRack.inc(incr);
    numfileFixBytesReadRemoteRack += incr;
  }