Package cascading.tuple

Examples of cascading.tuple.Tuple


    @Override
    public void operate(FlowProcess flowProcess, FunctionCall<NullContext> funcCall) {
        ParsedDatum datum = new ParsedDatum(funcCall.getArguments());
        Text key = new Text(datum.getUrl());
        Text value = new Text(datum.getTitle() + '\n' + datum.getParsedText());
        Tuple keyVal = new Tuple(key, value);
        funcCall.getOutputCollector().add(keyVal);
    }
View Full Code Here


        long fetchTime = System.currentTimeMillis();
        PartitioningKey groupingKey = new PartitioningKey("key", 1);
        FetchSetDatum pfd1 = new FetchSetDatum(urls, fetchTime, 0, groupingKey.getValue(), groupingKey.getRef());
        pfd1.setLastList(true);
       
        Tuple t = pfd1.getTuple();
       
        FetchSetDatum pfd2 = new FetchSetDatum(t);
       
        Assert.assertEquals(pfd1, pfd2);
    }
View Full Code Here

       
        String value3 = "value3\nwith\nreturns";
        headers.add("key3", value3);
        FetchedDatum datum = new FetchedDatum(url, url, 0, headers, new ContentBytes(), "", 0);
       
        Tuple tuple = datum.getTuple();
       
        FetchedDatum newDatum = new FetchedDatum(tuple);
       
        HttpHeaders newHeaders = newDatum.getHeaders();
        assertEquals("value", newHeaders.getFirst(key1));
View Full Code Here

            // Now we might need to remain the address, if this user has aliases.
            if (EMAIL_ALIASES.containsKey(address)) {
              address = EMAIL_ALIASES.get(address);
            }

            Tuple tuple = new Tuple(messageId, address, name, 0.0);
            functionCall.getOutputCollector().add(tuple);

            String replyId = metadata.get(Metadata.RELATION);

            if (replyId != null) {
              double score = analyzeReply(_content.toString());
              if (score > 0.0) {
                tuple = new Tuple(replyId, null, null, score);
                functionCall.getOutputCollector().add(tuple);
              }
            }
          } catch (Exception e) {
        LOGGER.error("Exception parsing email message", e);
View Full Code Here

      }

      emailNames.setLength(emailNames.length() - 2);
    }
   
    bufferCall.getOutputCollector().add(new Tuple(emailAddress, emailNames.toString(), summedScore));
  }
View Full Code Here

        HttpHeaders headers = new HttpHeaders();
        String key1 = "key\twith\ttabs";
        String value1 = "value1";
        headers.add(key1, value1);
       
        Tuple t = headers.toTuple();
        HttpHeaders newHeaders = new HttpHeaders(t);
        assertEquals(1, newHeaders.getNames().size());
        assertEquals(value1, newHeaders.getFirst(key1));
       
        String key2 = "key\n\r\fwith lots of funky chars";
View Full Code Here

     
      score += entry.getDouble(FieldNames.SCORE);
    }
   
    if (email != null) {
      bufferCall.getOutputCollector().add(new Tuple(email, name, score));
    }
  }
View Full Code Here

        TupleEntryCollector collector = funcCall.getOutputCollector();
        PageResult[] pageResults = datum.getPageResults();
        if (pageResults.length > 0) {
            for (PageResult pageResult : pageResults) {
                String outResult = String.format("%s\t%s\t%s", pageResult.getSourceUrl(), pageResult.getImageUrl(), pageResult.getDescription());
                collector.add(new Tuple(outResult));
            }
        }
    }
View Full Code Here

        OperationCall<NullContext> oc = Mockito.mock(OperationCall.class);
        BufferCall<NullContext> bc = Mockito.mock(BufferCall.class);
       
        TupleEntryCollector collector = Mockito.mock(TupleEntryCollector.class);
       
        Mockito.when(bc.getGroup()).thenReturn(new TupleEntry(new Tuple("http://localhost:8089")));
        Mockito.when(bc.getArgumentsIterator()).thenReturn(getGroupedurlDatumList("http://localhost:8089").iterator());
        Mockito.when(bc.getOutputCollector()).thenReturn(collector);
       
        TestWebServer server = null;
       
View Full Code Here

        OperationCall<NullContext> oc = Mockito.mock(OperationCall.class);
        BufferCall<NullContext> bc = Mockito.mock(BufferCall.class);
       
        TupleEntryCollector collector = Mockito.mock(TupleEntryCollector.class);
       
        Mockito.when(bc.getGroup()).thenReturn(new TupleEntry(new Tuple("http://localhost:8089")));
        Mockito.when(bc.getArgumentsIterator()).thenReturn(getGroupedurlDatumList("http://localhost:8089").iterator());
        Mockito.when(bc.getOutputCollector()).thenReturn(collector);
       
        TestWebServer server = null;
       
View Full Code Here

TOP

Related Classes of cascading.tuple.Tuple

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.