public class TransformSplit extends BaseInputSplit
Modifier and Type | Class and Description |
---|---|
static interface |
TransformSplit.URITransform |
length, locations
Constructor and Description |
---|
TransformSplit(BaseInputSplit sourceSplit,
TransformSplit.URITransform transform)
Apply a given transformation to the raw URI objects
|
Modifier and Type | Method and Description |
---|---|
static TransformSplit |
ofSearchReplace(BaseInputSplit sourceSplit,
String search,
String replace)
Static factory method, replace the string version of the URI with a simple search-replace pair
|
void |
readFields(DataInput in)
Deserialize the fields of this object from
in . |
void |
write(DataOutput out)
Serialize the fields of this object to
out . |
public TransformSplit(@NonNull BaseInputSplit sourceSplit, @NonNull TransformSplit.URITransform transform) throws URISyntaxException
sourceSplit
- the split with URIs to transformtransform
- transform operation that returns a new URI based on an input URIURISyntaxException
- thrown if the transformed URI is malformedpublic static TransformSplit ofSearchReplace(@NonNull BaseInputSplit sourceSplit, @NonNull String search, @NonNull String replace) throws URISyntaxException
sourceSplit
- the split with URIs to transformsearch
- the string to searchreplace
- the string to replace withURISyntaxException
- thrown if the transformed URI is malformedpublic void write(DataOutput out) throws IOException
Writable
out
.out
- DataOuput
to serialize this object into.IOException
public void readFields(DataInput in) throws IOException
Writable
in
.
For efficiency, implementations should attempt to re-use storage in the existing object where possible.
in
- DataInput
to deseriablize this object from.IOException
Copyright © 2016. All rights reserved.