Package bixo.datum

Examples of bixo.datum.StatusDatum


            FetchedDatum fd = new FetchedDatum(entry);
           
            // Get the fetch status that we hang on the end of the tuple,
            // after all of the FetchedDatum fields.
            Object result = entry.getObject(_fieldPos);
            StatusDatum status;
           
            // Note: Here we share the payload of the FetchedDatum with the
            // StatusDatum we're about to emit, but since we let go after we
            // emit, there shouldn't be an issue with this sharing.
            if (result instanceof String) {
                UrlStatus urlStatus = UrlStatus.valueOf((String)result);
                if (urlStatus == UrlStatus.FETCHED) {
                    status = new StatusDatum(fd.getUrl(), fd.getHeaders(), fd.getHostAddress(), fd.getPayload());
                } else {
                    status = new StatusDatum(fd.getUrl(), urlStatus, fd.getPayload());
                }
            } else if (result instanceof BaseFetchException) {
                status = new StatusDatum(fd.getUrl(), (BaseFetchException)result, fd.getPayload());
            } else {
                throw new RuntimeException("Unknown type for fetch status field: " + result.getClass());
            }
           
            funcCall.getOutputCollector().add(BixoPlatform.clone(status.getTuple(), process));
        }
View Full Code Here


            }
           
            // Note: Here we share the payload of the ScoredUrlDatum with the
            // StatusDatum we're about to emit, but since we let go after we
            // emit, there shouldn't be an issue with this sharing.
            StatusDatum status = new StatusDatum(sd.getUrl(), GroupingKey.makeUrlStatusFromKey(key), sd.getPayload());
            status.setPayload(sd);
           
            funcCall.getOutputCollector().add(BixoPlatform.clone(status.getTuple(), process));
        }
View Full Code Here

TOP

Related Classes of bixo.datum.StatusDatum

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.