Package org.apache.accumulo.core.data
Class LoadPlan
java.lang.Object
org.apache.accumulo.core.data.LoadPlan
Information about where to load files into an Accumulo table.
- Since:
- 2.0.0
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interface
static class
Mapping of a file to a row range with an associated range type.static enum
static interface
A function that maps a row to two table split points that contain the row.static class
Represents two split points that exist in a table being bulk imported to. -
Method Summary
Modifier and TypeMethodDescriptionstatic LoadPlan.Builder
builder()
static LoadPlan
Computes a load plan for a given rfile.static LoadPlan
compute
(URI file, LoadPlan.SplitResolver splitResolver) Computes a load plan for a given rfile.static LoadPlan
Deserializes json to a load plan.toJson()
Serializes the load plan to json that looks like the following.
-
Method Details
-
getDestinations
-
builder
-
toJson
Serializes the load plan to json that looks like the following. The values of startRow and endRow field are base64 encoded usingBase64.getUrlEncoder()
.{ "destinations": [ { "fileName": "f1.rf", "startRow": null, "endRow": "MDAz", "rangeType": "TABLE" }, { "fileName": "f2.rf", "startRow": "MDA0", "endRow": "MDA3", "rangeType": "FILE" }, { "fileName": "f1.rf", "startRow": "MDA1", "endRow": "MDA2", "rangeType": "TABLE" }, { "fileName": "f3.rf", "startRow": "MDA4", "endRow": null, "rangeType": "TABLE" } ] }
- Since:
- 2.1.4
-
fromJson
Deserializes json to a load plan.- Parameters:
json
- produced bytoJson()
- Throws:
IllegalArgumentException
- when illegal json is given or legal json that does not follow the load plan schema is given. The minimal acceptable json is{"destinations":[]}
.NullPointerException
- when json argument is null- Since:
- 2.1.4
-
compute
Computes a load plan for a given rfile. This will open the rfile and find everyLoadPlan.TableSplits
that overlaps rows in the file and add those to the returned load plan.- Throws:
IOException
- Since:
- 2.1.4
-
compute
public static LoadPlan compute(URI file, Map<String, String> properties, LoadPlan.SplitResolver splitResolver) throws IOExceptionComputes a load plan for a given rfile. This will open the rfile and find everyLoadPlan.TableSplits
that overlaps rows in the file and add those to the returned load plan.- Parameters:
properties
- used when opening the rfile, seeRFile.ScannerOptions.withTableProperties(Map)
- Throws:
IOException
- Since:
- 2.1.4
-