Examples of ClusterData


Examples of org.apache.catalina.tribes.io.ClusterData

    public void send(Member[] destination, Serializable msg) throws ChannelException {
        if ( msg == null ) return;
        try {
            if ( destination == null ) destination = getMembers();
            int options = 0;
            ClusterData data = new ClusterData();//generates a unique Id
            data.setAddress(getLocalMember());
            data.setTimestamp(System.currentTimeMillis());
            byte[] b = null;
            if ( msg instanceof ByteMessage ){
                b = ((ByteMessage)msg).getMessage();
                options = options | BYTE_MESSAGE;
            } else {
                b = XByteBuffer.serialize(msg);
            }
            data.setOptions(options);
            XByteBuffer buffer = new XByteBuffer(b.length+128,false);
            buffer.append(b,0,b.length);
            data.setMessage(buffer);
            getFirstInterceptor().sendMessage(destination, data, null);
        }catch ( Exception x ) {
            if ( x instanceof ChannelException ) throw (ChannelException)x;
            throw new ChannelException(x);
        }
View Full Code Here

Examples of org.apache.catalina.tribes.io.ClusterData

        return ++counter;
    }
   
    public synchronized ClusterData getMessage(Member mbr) {
        String msg = new String("Thread-"+Thread.currentThread().getName()+" Message:"+inc());
        ClusterData data = new ClusterData(true);
        data.setMessage(new XByteBuffer(msg.getBytes(),false));
        data.setAddress(mbr);
        return data;
    }
View Full Code Here

Examples of org.apache.catalina.tribes.io.ClusterData

import org.apache.catalina.tribes.io.XByteBuffer;
import org.apache.catalina.tribes.io.ClusterData;
public class AckProtocol {
    public byte[] processInput(XByteBuffer buf, int counter) throws Exception {
        ClusterData data = buf.extractPackage(true);
        System.out.println("Received:\n\tThread:"+Thread.currentThread().getName()+"\n\tCount:"+counter+"\n\tData:"+new String(data.getMessage().getBytes()));
        return org.apache.catalina.tribes.tcp.Constants.ACK_COMMAND;
    }
View Full Code Here

Examples of org.apache.catalina.tribes.io.ClusterData

        return ++counter;
    }
   
    public synchronized ClusterData getMessage(Member mbr) {
        String msg = new String("Thread-"+Thread.currentThread().getName()+" Message:"+inc());
        ClusterData data = new ClusterData(true);
        data.setMessage(new XByteBuffer(msg.getBytes(),false));
        data.setAddress(mbr);
       
        return data;
    }
View Full Code Here

Examples of org.apache.catalina.tribes.io.ClusterData

import org.apache.catalina.tribes.io.XByteBuffer;
import org.apache.catalina.tribes.io.ClusterData;
public class AckProtocol {
    public byte[] processInput(XByteBuffer buf, int counter) throws Exception {
        ClusterData data = buf.extractPackage(true);
        System.out.println("Received:\n\tThread:"+Thread.currentThread().getName()+"\n\tCount:"+counter+"\n\tData:"+new String(data.getMessage().getBytes()));
        return org.apache.catalina.tribes.transport.Constants.ACK_COMMAND;
    }
View Full Code Here

Examples of org.apache.catalina.tribes.io.ClusterData

    public void send(Member[] destination, Serializable msg, int options, ErrorHandler handler) throws ChannelException {
        if ( msg == null ) return;
        try {
            if ( destination == null ) throw new ChannelException("No destination given");
            if ( destination.length == 0 ) return;
            ClusterData data = new ClusterData();//generates a unique Id
            data.setAddress(getLocalMember(false));
            data.setTimestamp(System.currentTimeMillis());
            byte[] b = null;
            if ( msg instanceof ByteMessage ){
                b = ((ByteMessage)msg).getMessage();
                options = options | SEND_OPTIONS_BYTE_MESSAGE;
            } else {
                b = XByteBuffer.serialize(msg);
            }
            data.setOptions(options);
            XByteBuffer buffer = new XByteBuffer(b.length+128,false);
            buffer.append(b,0,b.length);
            data.setMessage(buffer);
            InterceptorPayload payload = null;
            if ( handler != null ) {
                payload = new InterceptorPayload();
                payload.setErrorHandler(handler);
            }
View Full Code Here

Examples of picard.illumina.parser.ClusterData

                final BufferedWriter writer = IOUtil.openFileForBufferedWriting(barcodeFile);
                final byte barcodeSubsequences[][] = new byte[barcodeIndices.length][];
                final byte qualityScores[][] = usingQualityScores ? new byte[barcodeIndices.length][] : null;
                while (provider.hasNext()) {
                    // Extract the barcode from the cluster and write it to the file for the tile
                    final ClusterData cluster = provider.next();
                    for (int i = 0; i < barcodeIndices.length; i++) {
                        barcodeSubsequences[i] = cluster.getRead(barcodeIndices[i]).getBases();
                        if (usingQualityScores) qualityScores[i] = cluster.getRead(barcodeIndices[i]).getQualities();
                    }
                    final boolean passingFilter = cluster.isPf();
                    final BarcodeMatch match = findBestBarcodeAndUpdateMetrics(barcodeSubsequences, qualityScores, passingFilter, metrics, noMatch);

                    final String yOrN = (match.matched ? "Y" : "N");

                    for (final byte[] bc : barcodeSubsequences) {
View Full Code Here

Examples of picard.illumina.parser.ClusterData

                 *   is non-overlapping sets of files so make the data providers in the individual threads for Extractors
                 *   so they are not all waiting for each others file operations
                 */
                while (provider.hasNext()) {
                    // Extract the PF status and infer reason if FAIL from the cluster and update the summaryMetric for the tile
                    final ClusterData cluster = provider.next();
                    this.summaryMetric.READS++;
                    if (!cluster.isPf()) {
                        this.summaryMetric.PF_FAIL_READS++;

                        final ReadClassifier readClassifier = new ReadClassifier(cluster.getRead(0));

                        if (random.nextDouble() < pWriteDetailed) {
                            detailedMetrics.add(new PFFailDetailedMetric(tile, cluster.getX(), cluster.getY(), readClassifier.numNs, readClassifier.numQGtTwo, readClassifier.failClass));
                        }
                        switch (readClassifier.failClass) {
                            case EMPTY:
                                this.summaryMetric.PF_FAIL_EMPTY++;
                                break;
View Full Code Here

Examples of picard.illumina.parser.ClusterData

        //Initialize data provider, iterate over clusters, and collect statistics
        final IlluminaDataProvider provider = factory.makeDataProvider();

        while (provider.hasNext()) {
            final ClusterData cluster = provider.next();
            addCluster(cluster);
        }

        onComplete();
        return 0;
View Full Code Here

Examples of picard.illumina.parser.ClusterData

        public void process() {
            final IlluminaDataProvider dataProvider = factory.makeDataProvider(Arrays.asList(this.tile.getNumber()));
            log.debug(String.format("Reading data from tile %s ...", tile.getNumber()));

            while (dataProvider.hasNext()) {
                final ClusterData cluster = dataProvider.next();
                readProgressLogger.record(null, 0);
                // If this cluster is passing, or we do NOT want to ONLY emit passing reads, then add it to the next
                if (cluster.isPf() || includeNonPfReads) {
                    final String barcode = (demultiplex ? cluster.getMatchedBarcode() : null);
                    this.processingRecord.addRecord(barcode, converter.convertClusterToOutputRecord(cluster));
                }
            }

            this.handler.completeTile(this.tile);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.