Skip to content

DM-12616 Partial decimated data returned by a duplicate request #499

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 14, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ protected String getResultSetTablePrefix() {

protected DataGroup fetchData(TableServerRequest treq, File dbFile, DbAdapter dbAdapter) throws DataAccessException {

treq.setPageSize(Integer.MAX_VALUE);

DecimateInfo decimateInfo = getDecimateInfo(treq);
TableServerRequest sreq = getSearchRequest(treq);
sreq.setPageSize(Integer.MAX_VALUE); // we want all of the data. no paging
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public DataGroupPart getData(ServerRequest request) throws DataAccessException {
lockChecker.unlock();
}

// make sure multiple requests for the same data waits for the first one to create before acessing.
// make sure multiple requests for the same data waits for the first one to create before accessing.
lock.lock();
try {
boolean dbFileCreated = false;
Expand Down
2 changes: 2 additions & 0 deletions src/firefly/js/charts/ChartUtil.js
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,8 @@ export function getDataChangesForMappings({tableModel, mappings, traceNum}) {
});
getDataVal = (v) => transposed[cols.indexOf(v)];
} else {
// no tableModel case is for pre-fetch changes
changes[`fireflyData.${traceNum}.error`] = undefined;
getDataVal = (v) => v;
}

Expand Down
7 changes: 6 additions & 1 deletion src/firefly/js/charts/ChartsCntlr.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {getPointIdx, getRowIdx, handleTableSourceConnections, clearChartConn, ne
applyDefaults, HIGHLIGHTED_PROPS, SELECTED_PROPS, TBL_SRC_PATTERN} from './ChartUtil.js';
import {FilterInfo} from '../tables/FilterInfo.js';
import {SelectInfo} from '../tables/SelectInfo.js';
import {REINIT_APP} from '../core/AppDataCntlr.js';

export const CHART_SPACE_PATH = 'charts';
export const UI_PREFIX = `${CHART_SPACE_PATH}.ui`;
Expand Down Expand Up @@ -674,7 +675,11 @@ export function chartDataUpdate(payload) {
export function reducer(state={ui:{}, data:{}}, action={}) {

if (!action.type.startsWith(TablesCntlr.DATA_PREFIX) && !action.type.startsWith(CHART_SPACE_PATH)){
return state;
if (action.type === REINIT_APP) {
return {ui:{}, data:{}};
} else {
return state;
}
}

const nstate = {...state};
Expand Down
5 changes: 1 addition & 4 deletions src/firefly/js/charts/dataTypes/FireflyGenericData.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,7 @@ function fetchData(chartId, traceNum, tablesource) {
const originalTableModel = getTblById(tbl_id);
const {request, highlightedRow, selectInfo} = originalTableModel;

const req = makeTableFunctionRequest(request, 'XYGeneric');
req.startIdx = 0;
req.pageSize = MAX_ROW;

const req = makeTableFunctionRequest(request, 'XYGeneric', 'chart', {pageSize: MAX_ROW});

Object.entries(options).forEach(([k,v]) => v && (req[k]=v));

Expand Down
5 changes: 3 additions & 2 deletions src/firefly/js/charts/dataTypes/FireflyHeatmap.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* License information at https://github.com/Caltech-IPAC/firefly/blob/master/License.txt
*/
import {get} from 'lodash';
import {getTblById, getColumn, cloneRequest, doFetchTable} from '../../tables/TableUtil.js';
import {getTblById, getColumn, doFetchTable} from '../../tables/TableUtil.js';
import {makeTableFunctionRequest, MAX_ROW} from '../../tables/TableRequestUtil.js';
import {dispatchChartUpdate, dispatchError, getChartData} from '../ChartsCntlr.js';
import {serializeDecimateInfo, parseDecimateKey} from '../../tables/Decimate.js';
Expand Down Expand Up @@ -56,7 +56,8 @@ function fetchData(chartId, traceNum, tablesource) {

const {xColOrExpr, yColOrExpr, maxbins, xyratio, xmin, xmax, ymin, ymax} = options;
// min rows for decimation is 0
const req = makeTableFunctionRequest(request, 'DecimateTable', 'heatmap', {decimate: serializeDecimateInfo(xColOrExpr, yColOrExpr, maxbins, xyratio, xmin, xmax, ymin, ymax, 0)})
const req = makeTableFunctionRequest(request, 'DecimateTable', 'heatmap',
{decimate: serializeDecimateInfo(xColOrExpr, yColOrExpr, maxbins, xyratio, xmin, xmax, ymin, ymax, 0), pageSize: MAX_ROW});

doFetchTable(req).then((tableModel) => {
if (tableModel.tableData && tableModel.tableData.data) {
Expand Down
5 changes: 2 additions & 3 deletions src/firefly/js/charts/dataTypes/FireflyHistogram.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import {get, isArray} from 'lodash';
import {logError} from '../../util/WebUtil.js';
import {getTblById, doFetchTable} from '../../tables/TableUtil.js';
import {makeTableFunctionRequest} from '../../tables/TableRequestUtil.js';
import {makeTableFunctionRequest, MAX_ROW} from '../../tables/TableRequestUtil.js';
import {dispatchChartUpdate, dispatchError, getChartData} from '../ChartsCntlr.js';


Expand Down Expand Up @@ -59,7 +59,7 @@ function fetchData(chartId, traceNum, tablesource) {
const tableModel = getTblById(tbl_id);
const {request} = tableModel;

const req = makeTableFunctionRequest(request, 'HistogramProcessor');
const req = makeTableFunctionRequest(request, 'HistogramProcessor', 'histogram', {pageSize: MAX_ROW});

Object.entries(options).forEach(([k,v]) => req[k] = v);

Expand Down Expand Up @@ -106,7 +106,6 @@ function fetchData(chartId, traceNum, tablesource) {
}
).catch(
(reason) => {
//console.error(`Failed to fetch histogram data for ${chartId} trace ${traceNum}: ${reason}`);
dispatchError(chartId, traceNum, reason);
}
);
Expand Down
4 changes: 2 additions & 2 deletions src/firefly/js/charts/dataTypes/HistogramCDT.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {get} from 'lodash';

import {fetchTable} from '../../rpc/SearchServicesJson.js';
import {getTblById, isFullyLoaded} from '../../tables/TableUtil.js';
import {makeTableFunctionRequest} from '../../tables/TableRequestUtil.js';
import {makeTableFunctionRequest, MAX_ROW} from '../../tables/TableRequestUtil.js';
import {getChartDataElement, chartDataUpdate} from './../ChartsCntlr.js';
import {logError} from '../../util/WebUtil.js';

Expand Down Expand Up @@ -99,7 +99,7 @@ function fetchColData(dispatch, chartId, chartDataElementId) {
const activeTableServerRequest = activeTableModel['request'];
const tblSource = get(activeTableModel, 'tableMeta.resultSetID');

const req = makeTableFunctionRequest(activeTableServerRequest, 'HistogramProcessor');
const req = makeTableFunctionRequest(activeTableServerRequest, 'HistogramProcessor', 'histogram', {pageSize: MAX_ROW});

// histogram parameters
req.columnExpression = histogramParams.columnOrExpr;
Expand Down
3 changes: 2 additions & 1 deletion src/firefly/js/visualize/saga/CatalogWatcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,8 @@ function handleCatalogUpdate(tbl_id) {
let req = cloneRequest(sourceTable.request, params);
var dataTooBigForSelection= false;
if (totalRows>50000) {
req = makeTableFunctionRequest(sourceTable.request, 'DecimateTable', 'heatmap', {decimate: serializeDecimateInfo(columns.lonCol, columns.latCol, 10000)});
req = makeTableFunctionRequest(sourceTable.request, 'DecimateTable', 'heatmap',
{decimate: serializeDecimateInfo(columns.lonCol, columns.latCol, 10000), pageSize: MAX_ROW});
dataTooBigForSelection= true;
}

Expand Down
6 changes: 4 additions & 2 deletions src/firefly/js/visualize/saga/CoverageWatcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ function removeCoverage(tbl_id, decimatedTables) {
}

/**
*
* @param {boolean} useHiPS
* @param {string} tbl_id
* @param {string} viewerId
* @param decimatedTables
Expand All @@ -227,7 +227,8 @@ function updateCoverage(useHiPS, tbl_id, viewerId, decimatedTables, options) {
if (table.totalRows>10000) {
const cenCol= options.getCenterColumns(table);
params.decimate= serializeDecimateInfo(cenCol.lonCol, cenCol.latCol, 10000);
req = makeTableFunctionRequest(table.request, 'DecimateTable', 'coverage', {decimate: serializeDecimateInfo(cenCol.lonCol, cenCol.latCol, 10000)});
req = makeTableFunctionRequest(table.request, 'DecimateTable', 'coverage',
{decimate: serializeDecimateInfo(cenCol.lonCol, cenCol.latCol, 10000), pageSize: MAX_ROW});
}

req.tbl_id = `cov-${tbl_id}`;
Expand Down Expand Up @@ -259,6 +260,7 @@ function updateCoverage(useHiPS, tbl_id, viewerId, decimatedTables, options) {
/**
*
* @param {string} viewerId
* @param {boolean} useHiPS
* @param {TableData} table
* @param {CoverageOptions} options
* @param {string} tbl_id
Expand Down