Class LoadPlan

java.lang.Object
org.apache.accumulo.core.data.LoadPlan

public class LoadPlan extends Object
Information about where to load files into an Accumulo table.
Since:
2.0.0
See Also:
  • Method Details

    • getDestinations

      public Collection<LoadPlan.Destination> getDestinations()
    • builder

      public static LoadPlan.Builder builder()
    • toJson

      public String toJson()
      Serializes the load plan to json that looks like the following. The values of startRow and endRow field are base64 encoded using Base64.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

      public static LoadPlan fromJson(String json)
      Deserializes json to a load plan.
      Parameters:
      json - produced by toJson()
      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

      public static LoadPlan compute(URI file, LoadPlan.SplitResolver splitResolver) throws IOException
      Computes a load plan for a given rfile. This will open the rfile and find every LoadPlan.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 IOException
      Computes a load plan for a given rfile. This will open the rfile and find every LoadPlan.TableSplits that overlaps rows in the file and add those to the returned load plan.
      Parameters:
      properties - used when opening the rfile, see RFile.ScannerOptions.withTableProperties(Map)
      Throws:
      IOException
      Since:
      2.1.4