Search in sources :

Example 1 with DynamicDataSet

use of krati.store.DynamicDataSet in project camel by apache.

the class KratiHelper method createDataSet.

/**
     * Creates a {@link krati.store.DynamicDataSet} with the given parameters.
     *
     * @param path            The directory which the set will use.
     * @param initialCapacity
     * @param segmentFactory  The segment factory, defaults to {@link krati.core.segment.ChannelSegmentFactory}.
     * @return
     */
public static DataSet<byte[]> createDataSet(String path, int initialCapacity, SegmentFactory segmentFactory) {
    DataSet<byte[]> result = null;
    File homeDir = new File(path);
    homeDir.mkdirs();
    try {
        result = new DynamicDataSet(homeDir, initialCapacity, segmentFactory);
    } catch (Exception e) {
        throw new RuntimeCamelException("Failed to create Krati DataSet. This exception is ignored.", e);
    }
    return result;
}
Also used : DynamicDataSet(krati.store.DynamicDataSet) RuntimeCamelException(org.apache.camel.RuntimeCamelException) File(java.io.File) RuntimeCamelException(org.apache.camel.RuntimeCamelException)

Aggregations

File (java.io.File)1 DynamicDataSet (krati.store.DynamicDataSet)1 RuntimeCamelException (org.apache.camel.RuntimeCamelException)1