Package org.dashbuilder.dataset.engine.index

Examples of org.dashbuilder.dataset.engine.index.DataSetIndex


    public DataSet lookupDataSet(DataSetLookup lookup) {
        String uuid = lookup.getDataSetUUID();
        if (StringUtils.isEmpty(uuid)) return null;

        // Get the target data set
        DataSetIndex dataSetIndex = dataSetOpEngine.getIndexRegistry().get(uuid);
        if (dataSetIndex == null) return null;
        DataSet dataSet = dataSetIndex.getDataSet();

        // Apply the list of operations specified (if any).
        if (!lookup.getOperationList().isEmpty()) {
            dataSet = dataSetOpEngine.execute(dataSetIndex.getDataSet(), lookup.getOperationList());
        }

        // Trim the data set as requested.
        dataSet = dataSet.trim(lookup.getRowOffset(), lookup.getNumberOfRows());
        return dataSet;
View Full Code Here


        dataSet.setUUID(uuid);
        return dataSet;
    }

    public DataSet getDataSet(String uuid) {
        DataSetIndex index = fetchDataSet(uuid);
        if (index == null) return null;

        return index.getDataSet();
    }
View Full Code Here

            dataSetRegisteredEvent.fire(new DataSetBackendRegisteredEvent(dataSet.getMetadata()));
        }
    }

    public DataSet removeDataSet(String uuid) {
        DataSetIndex index = dataSetOpEngine.getIndexRegistry().remove(uuid);
        if (index == null) return null;

        // Fire an event before return.
        DataSet dataSet = index.getDataSet();
        dataSetRemovedEvent.fire(new DataSetBackendRemovedEvent(dataSet.getMetadata()));
        return dataSet;

    }
View Full Code Here

    }

    public DataSet refreshDataSet(String uuid) {
        dataSetOpEngine.getIndexRegistry().remove(uuid);
        DataSetIndex index = fetchDataSet(uuid);
        if (index == null) return null;

        return index.getDataSet();
    }
View Full Code Here

    public DataSet lookupDataSet(DataSetLookup lookup) {
        String uuid = lookup.getDataSetUUID();
        if (StringUtils.isEmpty(uuid)) return null;

        // Get the target data set
        DataSetIndex dataSetIndex = fetchDataSet(uuid);
        if (dataSetIndex == null) return null;
        DataSet dataSet = dataSetIndex.getDataSet();

        // Apply the list of operations specified (if any).
        if (!lookup.getOperationList().isEmpty()) {
            dataSet = dataSetOpEngine.execute(dataSetIndex.getDataSet(), lookup.getOperationList());
        }

        // Trim the data set as requested.
        dataSet = dataSet.trim(lookup.getRowOffset(), lookup.getNumberOfRows());
        return dataSet;
View Full Code Here

    }

    // Internal stuff

    protected DataSetIndex fetchDataSet(String uuid) {
        DataSetIndex index = dataSetOpEngine.getIndexRegistry().get(uuid);
        if (index != null) return index;

        return loadDataSet(uuid);
    }
View Full Code Here

TOP

Related Classes of org.dashbuilder.dataset.engine.index.DataSetIndex

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.