Tabnine Logo
DataSetMetadata.getEstimatedSize
Code IndexAdd Tabnine to your IDE (free)

How to use
getEstimatedSize
method
in
org.dashbuilder.dataset.DataSetMetadata

Best Java code snippets using org.dashbuilder.dataset.DataSetMetadata.getEstimatedSize (Showing top 11 results out of 315)

origin: kiegroup/appformer

@Test
public void testShow() throws Exception {
  final int estimatedSize = 100;
  final int rowCount = 10;
  when(dataSetMetadata.getEstimatedSize()).thenReturn(estimatedSize);
  when(dataSetMetadata.getNumberOfRows()).thenReturn(rowCount);
  presenter.show(dataSetDef);
  verify(view, times(0)).init(presenter);
  verify(view, times(1)).showStatusPanel(true, true, true);
  verify(view, times(1)).showSizePanelIcon(any(IconType.class), anyString(), anyString(), anyBoolean());
  verify(view, times(1)).showSizePanel(anyString(), anyString());
}
origin: org.kie.soup/kie-soup-dataset-sql

@Test
public void testAllColumns() throws Exception {
  URL fileURL = Thread.currentThread().getContextClassLoader().getResource("expenseReports_allcolumns.dset");
  String json = IOUtils.toString(fileURL, StandardCharsets.UTF_8);
  SQLDataSetDef def = (SQLDataSetDef) jsonMarshaller.fromJson(json);
  dataSetDefRegistry.registerDataSetDef(def);
  DataSetMetadata metadata = dataSetManager.getDataSetMetadata("expense_reports_allcolumns");
  assertThat(metadata.getNumberOfColumns()).isEqualTo(6);
  assertThat(metadata.getEstimatedSize()).isEqualTo(6350);
}
origin: org.dashbuilder/dashbuilder-widgets

@Override
public void callback(final DataSetMetadata metadata) {
  final int estimatedSize = metadata.getEstimatedSize();
  final int rowCount = metadata.getNumberOfRows();
  view.showSizePanel(humanReadableRowCount(rowCount) + " " + DataSetExplorerConstants.INSTANCE.rows(), 
      humanReadableByteCount(estimatedSize));
}
origin: kiegroup/appformer

@Override
public void callback(final DataSetMetadata metadata) {
  final int estimatedSize = metadata.getEstimatedSize();
  final int rowCount = metadata.getNumberOfRows();
  view.showSizePanel(humanReadableRowCount(rowCount) + " " + DataSetExplorerConstants.INSTANCE.rows(), 
      humanReadableByteCount(estimatedSize));
}
origin: org.dashbuilder/dashbuilder-dataset-client

public void callback(DataSetMetadata metatada) {
  // Push the data set to client if and only if the push feature is enabled, the data set is
  // pushable & the data set is smaller than the max push size defined.
  DataSetDef dsetDef = metatada.getDefinition();
  int estimatedSize = metatada.getEstimatedSize() / 1000;
  boolean isPushable = dsetDef != null && dsetDef.isPushEnabled() && estimatedSize < dsetDef.getPushMaxSize();
  if (pushRemoteDataSetEnabled && isPushable) {
    // Check if a push is already in progress.
    // (This is necessary in order to avoid repeating multiple push requests over the same data set).
    DataSetPushHandler pushHandler = pushRequestMap.get(request.getDataSetUUID());
    if (pushHandler == null) {
      // Create a push handler.
      pushHandler = new DataSetPushHandler(metatada);
      // Send the lookup request to the server...
      DataSetLookup lookupSourceDataSet = new DataSetLookup(request.getDataSetUUID());
      _lookupDataSet(lookupSourceDataSet,
              pushHandler);
    }
    // Register the lookup request into the current handler.
    pushHandler.registerLookup(request,
                  listener);
  }
  // Lookup the remote data set otherwise.
  else {
    _lookupDataSet(request,
            listener);
  }
}
origin: kiegroup/appformer

public void callback(DataSetMetadata metatada) {
  // Push the data set to client if and only if the push feature is enabled, the data set is
  // pushable & the data set is smaller than the max push size defined.
  DataSetDef dsetDef = metatada.getDefinition();
  int estimatedSize = metatada.getEstimatedSize() / 1000;
  boolean isPushable = dsetDef != null && dsetDef.isPushEnabled() && estimatedSize < dsetDef.getPushMaxSize();
  if (pushRemoteDataSetEnabled && isPushable) {
    // Check if a push is already in progress.
    // (This is necessary in order to avoid repeating multiple push requests over the same data set).
    DataSetPushHandler pushHandler = pushRequestMap.get(request.getDataSetUUID());
    if (pushHandler == null) {
      // Create a push handler.
      pushHandler = new DataSetPushHandler(metatada);
      // Send the lookup request to the server...
      DataSetLookup lookupSourceDataSet = new DataSetLookup(request.getDataSetUUID());
      _lookupDataSet(lookupSourceDataSet,
              pushHandler);
    }
    // Register the lookup request into the current handler.
    pushHandler.registerLookup(request,
                  listener);
  }
  // Lookup the remote data set otherwise.
  else {
    _lookupDataSet(request,
            listener);
  }
}
origin: org.kie.soup/kie-soup-dataset-sql

@Test
public void testColumnSet() throws Exception {
  URL fileURL = Thread.currentThread().getContextClassLoader().getResource("expenseReports_columnset.dset");
  String json = IOUtils.toString(fileURL, StandardCharsets.UTF_8);
  SQLDataSetDef def = (SQLDataSetDef) jsonMarshaller.fromJson(json);
  dataSetDefRegistry.registerDataSetDef(def);
  DataSetMetadata metadata = dataSetManager.getDataSetMetadata("expense_reports_columnset");
  assertThat(metadata.getNumberOfColumns()).isEqualTo(4);
  if (!testSettings.isMonetDB()) {
    assertThat(metadata.getEstimatedSize()).isEqualTo(4300);
  }
  final String uuid = "expense_reports_columnset";
  DataSet dataSet = dataSetManager.lookupDataSet(
      DataSetLookupFactory.newDataSetLookupBuilder()
          .dataset(uuid)
          .buildLookup());
  assertThat(dataSet.getColumns().size()).isEqualTo(4);
  assertThat(dataSet.getValueAt(0, 0)).isEqualTo("Engineering");
  assertThat(dataSet.getValueAt(0, 1)).isEqualTo("Roxie Foraker");
  assertThat(dataSet.getValueAt(0, 2)).isEqualTo(120.35d);
  assertThat(dataSetFormatter.formatValueAt(dataSet, 0, 3)).isEqualTo("12/11/15 12:00");
  assertDataSetDefinition(dataSet, uuid);
}
origin: org.dashbuilder/dashbuilder-dataset-sql

@Test
public void testAllColumns() throws Exception {
  URL fileURL = Thread.currentThread().getContextClassLoader().getResource("expenseReports_allcolumns.dset");
  String json = IOUtils.toString(fileURL);
  SQLDataSetDef def = (SQLDataSetDef) jsonMarshaller.fromJson(json);
  dataSetDefRegistry.registerDataSetDef(def);
  DataSetMetadata metadata = dataSetManager.getDataSetMetadata("expense_reports_allcolumns");
  assertThat(metadata.getNumberOfColumns()).isEqualTo(6);
  assertThat(metadata.getEstimatedSize()).isEqualTo(6350);
}
origin: org.kie.soup/kie-soup-dataset-sql

@Test
public void testFilters() throws Exception {
  URL fileURL = Thread.currentThread().getContextClassLoader().getResource("expenseReports_filtered.dset");
  String json = IOUtils.toString(fileURL, StandardCharsets.UTF_8);
  SQLDataSetDef def = (SQLDataSetDef) jsonMarshaller.fromJson(json);
  dataSetDefRegistry.registerDataSetDef(def);
  final String uuid = "expense_reports_filtered";
  DataSetMetadata metadata = dataSetManager.getDataSetMetadata(uuid);
  assertThat(metadata.getNumberOfColumns()).isEqualTo(5);
  if (!testSettings.isMonetDB()) {
    assertThat(metadata.getEstimatedSize()).isEqualTo(666);
  }
  DataSet dataSet = dataSetManager.lookupDataSet(
      DataSetLookupFactory.newDataSetLookupBuilder()
          .dataset(uuid)
          .group(COLUMN_DEPARTMENT)
          .column(COLUMN_DEPARTMENT)
          .column(COLUMN_EMPLOYEE)
          .column(COLUMN_AMOUNT, AggregateFunctionType.SUM)
          .sort(COLUMN_DEPARTMENT, SortOrder.DESCENDING)
          .buildLookup());
  assertDataSetDefinition(dataSet, uuid);
  assertDataSetValues(dataSet, dataSetFormatter, new String[][]{
      {"Services", "Jamie Gilbeau", "792.59"},
      {"Engineering", "Roxie Foraker", "2,120.55"}
  }, 0);
}
origin: org.dashbuilder/dashbuilder-dataset-sql

@Test
public void testFilters() throws Exception {
  URL fileURL = Thread.currentThread().getContextClassLoader().getResource("expenseReports_filtered.dset");
  String json = IOUtils.toString(fileURL);
  SQLDataSetDef def = (SQLDataSetDef) jsonMarshaller.fromJson(json);
  dataSetDefRegistry.registerDataSetDef(def);
  final String uuid = "expense_reports_filtered";
  DataSetMetadata metadata = dataSetManager.getDataSetMetadata(uuid);
  assertThat(metadata.getNumberOfColumns()).isEqualTo(5);
  if (!testSettings.isMonetDB()) {
    assertThat(metadata.getEstimatedSize()).isEqualTo(666);
  }
  DataSet dataSet = dataSetManager.lookupDataSet(
      DataSetLookupFactory.newDataSetLookupBuilder()
          .dataset(uuid)
          .group(COLUMN_DEPARTMENT)
          .column(COLUMN_DEPARTMENT)
          .column(COLUMN_EMPLOYEE)
          .column(COLUMN_AMOUNT, AggregateFunctionType.SUM)
          .sort(COLUMN_DEPARTMENT, SortOrder.DESCENDING)
          .buildLookup());
  assertDataSetDefinition(dataSet, uuid);
  assertDataSetValues(dataSet, dataSetFormatter, new String[][]{
      {"Services", "Jamie Gilbeau", "792.59"},
      {"Engineering", "Roxie Foraker", "2,120.55"}
  }, 0);
}
origin: org.dashbuilder/dashbuilder-dataset-sql

@Test
public void testColumnSet() throws Exception {
  URL fileURL = Thread.currentThread().getContextClassLoader().getResource("expenseReports_columnset.dset");
  String json = IOUtils.toString(fileURL);
  SQLDataSetDef def = (SQLDataSetDef) jsonMarshaller.fromJson(json);
  dataSetDefRegistry.registerDataSetDef(def);
  DataSetMetadata metadata = dataSetManager.getDataSetMetadata("expense_reports_columnset");
  assertThat(metadata.getNumberOfColumns()).isEqualTo(4);
  if (!testSettings.isMonetDB()) {
    assertThat(metadata.getEstimatedSize()).isEqualTo(4300);
  }
  final String uuid = "expense_reports_columnset";
  DataSet dataSet = dataSetManager.lookupDataSet(
      DataSetLookupFactory.newDataSetLookupBuilder()
          .dataset(uuid)
          .buildLookup());
  assertThat(dataSet.getColumns().size()).isEqualTo(4);
  assertThat(dataSet.getValueAt(0, 0)).isEqualTo("Engineering");
  assertThat(dataSet.getValueAt(0, 1)).isEqualTo("Roxie Foraker");
  assertThat(dataSet.getValueAt(0, 2)).isEqualTo(120.35d);
  assertThat(dataSetFormatter.formatValueAt(dataSet, 0, 3)).isEqualTo("12/11/15 12:00");
  assertDataSetDefinition(dataSet, uuid);
}
org.dashbuilder.datasetDataSetMetadatagetEstimatedSize

Javadoc

Get the estimated size in bytes.

Popular methods of DataSetMetadata

  • getColumnId
    Get the identifier of the specified column.
  • getNumberOfColumns
    Get the number of columns.
  • getColumnType
    Get the type of the specified column.
  • getNumberOfRows
    Get the number of rows.
  • getUUID
    The unique identifier for this data set.
  • getColumnIds
    Get the column ids
  • getDefinition
    Get the definition this data set has been created from. Is null for manually created data set instan

Popular in Java

  • Reading from database using SQL prepared statement
  • setContentView (Activity)
  • addToBackStack (FragmentTransaction)
  • getResourceAsStream (ClassLoader)
  • Graphics2D (java.awt)
    This Graphics2D class extends the Graphics class to provide more sophisticated control overgraphics
  • Menu (java.awt)
  • FileNotFoundException (java.io)
    Thrown when a file specified by a program cannot be found.
  • FileReader (java.io)
    A specialized Reader that reads from a file in the file system. All read requests made by calling me
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • TreeSet (java.util)
    TreeSet is an implementation of SortedSet. All optional operations (adding and removing) are support
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now