public class UrlLengthener
extends cascading.operation.BaseOperation<com.scaleunlimited.cascading.NullContext>
implements cascading.operation.Function<com.scaleunlimited.cascading.NullContext>
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
URL_FN |
Constructor and Description |
---|
UrlLengthener(BaseFetcher fetcher) |
UrlLengthener(BaseFetcher fetcher,
cascading.tuple.Fields resultField) |
Modifier and Type | Method and Description |
---|---|
void |
cleanup(cascading.flow.FlowProcess flowProcess,
cascading.operation.OperationCall<com.scaleunlimited.cascading.NullContext> operationCall) |
void |
flush(cascading.flow.FlowProcess flowProcess,
cascading.operation.OperationCall<com.scaleunlimited.cascading.NullContext> perationCall) |
static java.util.Set<java.lang.String> |
loadUrlShorteners() |
static BaseFetcher |
makeFetcher(int maxThreads,
UserAgent userAgent)
Return a SimpleHttpFetcher that's appropriate for lengthening URLs.
|
void |
operate(cascading.flow.FlowProcess flowProcess,
cascading.operation.FunctionCall<com.scaleunlimited.cascading.NullContext> functionCall) |
void |
prepare(cascading.flow.FlowProcess flowProcess,
cascading.operation.OperationCall<com.scaleunlimited.cascading.NullContext> operationCall) |
equals, getFieldDeclaration, getNumArgs, getTrace, hashCode, isSafe, printOperationInternal, toString, toStringInternal
public static final java.lang.String URL_FN
public UrlLengthener(BaseFetcher fetcher) throws java.io.IOException
java.io.IOException
public UrlLengthener(BaseFetcher fetcher, cascading.tuple.Fields resultField) throws java.io.IOException
java.io.IOException
public static BaseFetcher makeFetcher(int maxThreads, UserAgent userAgent)
maxThreads
- - number of requests to make in parallel. Should be 1 to 100?userAgent
- - what to use when making requests.public void prepare(cascading.flow.FlowProcess flowProcess, cascading.operation.OperationCall<com.scaleunlimited.cascading.NullContext> operationCall)
prepare
in interface cascading.operation.Operation<com.scaleunlimited.cascading.NullContext>
prepare
in class cascading.operation.BaseOperation<com.scaleunlimited.cascading.NullContext>
public void flush(cascading.flow.FlowProcess flowProcess, cascading.operation.OperationCall<com.scaleunlimited.cascading.NullContext> perationCall)
flush
in interface cascading.operation.Operation<com.scaleunlimited.cascading.NullContext>
flush
in class cascading.operation.BaseOperation<com.scaleunlimited.cascading.NullContext>
public void cleanup(cascading.flow.FlowProcess flowProcess, cascading.operation.OperationCall<com.scaleunlimited.cascading.NullContext> operationCall)
cleanup
in interface cascading.operation.Operation<com.scaleunlimited.cascading.NullContext>
cleanup
in class cascading.operation.BaseOperation<com.scaleunlimited.cascading.NullContext>
public void operate(cascading.flow.FlowProcess flowProcess, cascading.operation.FunctionCall<com.scaleunlimited.cascading.NullContext> functionCall)
operate
in interface cascading.operation.Function<com.scaleunlimited.cascading.NullContext>
public static java.util.Set<java.lang.String> loadUrlShorteners() throws java.io.IOException
java.io.IOException
Copyright © 2012 Bixo Labs