This list is closed, nobody may subscribe to it.
2010 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(139) |
Aug
(94) |
Sep
(232) |
Oct
(143) |
Nov
(138) |
Dec
(55) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2011 |
Jan
(127) |
Feb
(90) |
Mar
(101) |
Apr
(74) |
May
(148) |
Jun
(241) |
Jul
(169) |
Aug
(121) |
Sep
(157) |
Oct
(199) |
Nov
(281) |
Dec
(75) |
2012 |
Jan
(107) |
Feb
(122) |
Mar
(184) |
Apr
(73) |
May
(14) |
Jun
(49) |
Jul
(26) |
Aug
(103) |
Sep
(133) |
Oct
(61) |
Nov
(51) |
Dec
(55) |
2013 |
Jan
(59) |
Feb
(72) |
Mar
(99) |
Apr
(62) |
May
(92) |
Jun
(19) |
Jul
(31) |
Aug
(138) |
Sep
(47) |
Oct
(83) |
Nov
(95) |
Dec
(111) |
2014 |
Jan
(125) |
Feb
(60) |
Mar
(119) |
Apr
(136) |
May
(270) |
Jun
(83) |
Jul
(88) |
Aug
(30) |
Sep
(47) |
Oct
(27) |
Nov
(23) |
Dec
|
2015 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(3) |
Oct
|
Nov
|
Dec
|
2016 |
Jan
|
Feb
|
Mar
(4) |
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <tob...@us...> - 2014-07-22 00:33:22
|
Revision: 8584 http://sourceforge.net/p/bigdata/code/8584 Author: tobycraig Date: 2014-07-22 00:33:17 +0000 (Tue, 22 Jul 2014) Log Message: ----------- Fixed issue with placeholder text for query/update textboxes Modified Paths: -------------- branches/BIGDATA_RELEASE_1_3_0/bigdata-war/src/html/js/workbench.js Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata-war/src/html/js/workbench.js =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-war/src/html/js/workbench.js 2014-07-22 00:02:38 UTC (rev 8583) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-war/src/html/js/workbench.js 2014-07-22 00:33:17 UTC (rev 8584) @@ -7,8 +7,7 @@ // query/update editors var EDITORS = {}, ERROR_LINE_MARKERS = {}, ERROR_CHARACTER_MARKERS = {}; -var CODEMIRROR_DEFAULTS = {}; -CodeMirror.defaults = { +var CODEMIRROR_DEFAULTS = { lineNumbers: true, mode: 'sparql', extraKeys: {'Ctrl-,': moveTabLeft, 'Ctrl-.': moveTabRight} @@ -601,7 +600,7 @@ } function createUpdateEditor() { - EDITORS.update = CodeMirror.fromTextArea($('#update-box')[0], CODEMIRROR_DEFAULTS); + EDITORS.update = CodeMirror.fromTextArea($('#update-box')[0], copyObject(CODEMIRROR_DEFAULTS)); EDITORS.update.on('change', function() { if(ERROR_LINE_MARKERS.update) { ERROR_LINE_MARKERS.update.clear(); @@ -732,7 +731,7 @@ } function createQueryEditor() { - EDITORS.query = CodeMirror.fromTextArea($('#query-box')[0], CODEMIRROR_DEFAULTS); + EDITORS.query = CodeMirror.fromTextArea($('#query-box')[0], copyObject(CODEMIRROR_DEFAULTS)); EDITORS.query.on('change', function() { if(ERROR_LINE_MARKERS.query) { ERROR_LINE_MARKERS.query.clear(); @@ -1608,7 +1607,19 @@ return $('<div/>').text(text).html(); } +function copyObject(src) { + // this returns a new object with the same keys & values as the input one. + // It is used to get around CodeMirror updating the default config object + // passed to it with the values used, which are then applied to later uses + // of the default config object. + dest = {}; + for(var key in src) { + dest[key] = src[key]; + } + return dest; +} + /* Startup functions */ function setupHandlers() { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tob...@us...> - 2014-07-22 00:02:42
|
Revision: 8583 http://sourceforge.net/p/bigdata/code/8583 Author: tobycraig Date: 2014-07-22 00:02:38 +0000 (Tue, 22 Jul 2014) Log Message: ----------- Fixed tab selector shortcuts issue with health tab in standalone mode Modified Paths: -------------- branches/BIGDATA_RELEASE_1_3_0/bigdata-war/src/html/js/workbench.js Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata-war/src/html/js/workbench.js =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-war/src/html/js/workbench.js 2014-07-21 23:58:38 UTC (rev 8582) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-war/src/html/js/workbench.js 2014-07-22 00:02:38 UTC (rev 8583) @@ -1546,6 +1546,8 @@ $.get('/status?health', function(data) { if(data.deployment == 'HA') { $('#tab-selector a[data-target=health]').show(); + } else { + $('#tab-selector a[data-target=health]').remove(); } }); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tob...@us...> - 2014-07-21 23:58:40
|
Revision: 8582 http://sourceforge.net/p/bigdata/code/8582 Author: tobycraig Date: 2014-07-21 23:58:38 +0000 (Mon, 21 Jul 2014) Log Message: ----------- Reorganised and tidied up JS Modified Paths: -------------- branches/BIGDATA_RELEASE_1_3_0/bigdata-war/src/html/js/workbench.js Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata-war/src/html/js/workbench.js =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-war/src/html/js/workbench.js 2014-07-19 14:34:10 UTC (rev 8581) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-war/src/html/js/workbench.js 2014-07-21 23:58:38 UTC (rev 8582) @@ -1,9 +1,67 @@ $(function() { -// global variables -var RW_URL_PREFIX, RO_URL_PREFIX, DEFAULT_NAMESPACE, NAMESPACE, NAMESPACES_READY, NAMESPACE_SHORTCUTS, FILE_CONTENTS, QUERY_RESULTS; -var CODEMIRROR_DEFAULTS, EDITORS = {}, ERROR_LINE_MARKERS = {}, ERROR_CHARACTER_MARKERS = {}; -var PAGE_SIZE = 50, TOTAL_PAGES, CURRENT_PAGE; +/* Global variables */ + +// LBS/non-LBS URL prefixes +var RW_URL_PREFIX, RO_URL_PREFIX + +// query/update editors +var EDITORS = {}, ERROR_LINE_MARKERS = {}, ERROR_CHARACTER_MARKERS = {}; +var CODEMIRROR_DEFAULTS = {}; +CodeMirror.defaults = { + lineNumbers: true, + mode: 'sparql', + extraKeys: {'Ctrl-,': moveTabLeft, 'Ctrl-.': moveTabRight} +}; +// key is value of RDF type selector, value is name of CodeMirror mode +var RDF_MODES = { + 'n-triples': 'ntriples', + 'rdf/xml': 'xml', + 'json': 'json', + 'turtle': 'turtle' +}; +var FILE_CONTENTS; +// file/update editor type handling +// .xml is used for both RDF and TriX, assume it's RDF +// We could check the parent element to see which it is +var RDF_TYPES = { + 'nq': 'n-quads', + 'nt': 'n-triples', + 'n3': 'n3', + 'rdf': 'rdf/xml', + 'rdfs': 'rdf/xml', + 'owl': 'rdf/xml', + 'xml': 'rdf/xml', + 'json': 'json', + 'trig': 'trig', + 'trix': 'trix', + //'xml': 'trix', + 'ttl': 'turtle' +}; +var RDF_CONTENT_TYPES = { + 'n-quads': 'text/x-nquads', + 'n-triples': 'text/plain', + 'n3': 'text/rdf+n3', + 'rdf/xml': 'application/rdf+xml', + 'json': 'application/sparql-results+json', + 'trig': 'application/x-trig', + 'trix': 'application/trix', + 'turtle': 'application/x-turtle' +}; +var SPARQL_UPDATE_COMMANDS = [ + 'INSERT', + 'DELETE', + 'LOAD', + 'CLEAR' +]; + +// pagination +var QUERY_RESULTS, PAGE_SIZE = 50, TOTAL_PAGES, CURRENT_PAGE; + +// namespaces +var DEFAULT_NAMESPACE, NAMESPACE, NAMESPACES_READY; + +// namespace creation var NAMESPACE_PARAMS = { 'name': 'com.bigdata.rdf.sail.namespace', 'index': 'com.bigdata.rdf.store.AbstractTripleStore.textIndex', @@ -13,15 +71,51 @@ 'axioms': 'com.bigdata.rdf.store.AbstractTripleStore.axiomsClass' }; -CODEMIRROR_DEFAULTS = { - lineNumbers: true, - mode: 'sparql', - extraKeys: {'Ctrl-,': moveTabLeft, 'Ctrl-.': moveTabRight} +var NAMESPACE_SHORTCUTS = { + 'Bigdata': { + 'bd': 'http://www.bigdata.com/rdf#', + 'bds': 'http://www.bigdata.com/rdf/search#', + 'gas': 'http://www.bigdata.com/rdf/gas#', + 'hint': 'http://www.bigdata.com/queryHints#' + }, + 'W3C': { + 'rdf': 'http://www.w3.org/1999/02/22-rdf-syntax-ns#', + 'rdfs': 'http://www.w3.org/2000/01/rdf-schema#', + 'owl': 'http://www.w3.org/2002/07/owl#', + 'skos': 'http://www.w3.org/2004/02/skos/core#', + 'xsd': 'http://www.w3.org/2001/XMLSchema#' + }, + 'Dublin Core': { + 'dc': 'http://purl.org/dc/elements/1.1/', + 'dcterm': 'http://purl.org/dc/terms/', + 'void': 'http://rdfs.org/ns/void#' + }, + 'Social/Other': { + 'foaf': 'http://xmlns.com/foaf/0.1/', + 'schema': 'http://schema.org/', + 'sioc': 'http://rdfs.org/sioc/ns#' + } }; -// debug to access closure variables -$('html, textarea, select').bind('keydown', 'ctrl+d', function() { debugger; }); +// data export +var EXPORT_EXTENSIONS = { + "application/rdf+xml": ['RDF/XML', 'rdf', true], + "application/n-triples": ['N-Triples', 'nt', true], + "application/x-turtle": ['Turtle', 'ttl', true], + "text/rdf+n3": ['N3', 'n3', true], + "application/trix": ['TriX', 'trix', true], + "application/x-trig": ['TRIG', 'trig', true], + "text/x-nquads": ['NQUADS', 'nq', true], + "text/csv": ['CSV', 'csv', false, exportCSV], + "application/sparql-results+json": ['JSON', 'json', false, exportJSON], + // "text/tab-separated-values": ['TSV', 'tsv', false, exportTSV], + "application/sparql-results+xml": ['XML', 'xml', false, exportXML] +}; + + +/* Load balancing */ + function useLBS(state) { // allows passing in of boolean, or firing on event if(typeof(state) != 'boolean') { @@ -36,9 +130,8 @@ } $('.use-lbs').prop('checked', state); } -useLBS(true); -$('.use-lbs').change(useLBS); + /* Modal functions */ function showModal(id) { @@ -46,14 +139,15 @@ $('body').addClass('modal-open'); } -$('.modal-cancel').click(function() { +function closeModal() { $('body').removeClass('modal-open'); $(this).parents('.modal').hide(); -}); +} + /* Search */ -$('#search-form').submit(function(e) { +function submitSearch(e) { e.preventDefault(); var term = $(this).find('input').val(); if(!term) { @@ -64,13 +158,14 @@ $('#query-errors').hide(); $('#query-form').submit(); showTab('query'); -}); +} + /* Tab selection */ -$('#tab-selector a').click(function(e) { +function clickTab(e) { showTab($(this).data('target')); -}); +} function showTab(tab, nohash) { $('.tab').hide(); @@ -111,9 +206,6 @@ } } -// these should be , and . but Hotkeys views those keypresses as these characters -$('html, textarea, select').bind('keydown', 'ctrl+¼', moveTabLeft); -$('html, textarea, select').bind('keydown', 'ctrl+¾', moveTabRight); /* Namespaces */ @@ -270,14 +362,14 @@ return errors.length == 0; } -$('#new-namespace-mode').change(function() { +function changeNamespaceMode() { var quads = this.value == 'quads'; $('#new-namespace-inference').prop('disabled', quads); $('#inference-quads-incompatible').toggle(quads); if(quads) { $('#new-namespace-inference').prop('checked', false); } -}); +} function createNamespace(e) { e.preventDefault(); @@ -327,7 +419,6 @@ }; $.ajax(RW_URL_PREFIX + 'namespace', settings); } -$('#namespace-create').submit(createNamespace); function getDefaultNamespace() { $.get(RO_URL_PREFIX + 'namespace?describe-each-named-graph=false&describe-default-namespace=true', function(data) { @@ -339,60 +430,34 @@ }); } -getDefaultNamespace(); - /* Namespace shortcuts */ -NAMESPACE_SHORTCUTS = { - 'Bigdata': { - 'bd': 'http://www.bigdata.com/rdf#', - 'bds': 'http://www.bigdata.com/rdf/search#', - 'gas': 'http://www.bigdata.com/rdf/gas#', - 'hint': 'http://www.bigdata.com/queryHints#' - }, - 'W3C': { - 'rdf': 'http://www.w3.org/1999/02/22-rdf-syntax-ns#', - 'rdfs': 'http://www.w3.org/2000/01/rdf-schema#', - 'owl': 'http://www.w3.org/2002/07/owl#', - 'skos': 'http://www.w3.org/2004/02/skos/core#', - 'xsd': 'http://www.w3.org/2001/XMLSchema#' - }, - 'Dublin Core': { - 'dc': 'http://purl.org/dc/elements/1.1/', - 'dcterm': 'http://purl.org/dc/terms/', - 'void': 'http://rdfs.org/ns/void#' - }, - 'Social/Other': { - 'foaf': 'http://xmlns.com/foaf/0.1/', - 'schema': 'http://schema.org/', - 'sioc': 'http://rdfs.org/sioc/ns#' +function createNamespaceShortcuts() { + $('.namespace-shortcuts').html('Namespace shortcuts: '); + for(var category in NAMESPACE_SHORTCUTS) { + var select = $('<select><option>' + category + '</option></select>').appendTo($('.namespace-shortcuts')); + for(var ns in NAMESPACE_SHORTCUTS[category]) { + select.append('<option value="' + NAMESPACE_SHORTCUTS[category][ns] + '">' + ns + '</option>'); + } } -}; -$('.namespace-shortcuts').html('Namespace shortcuts: '); -for(var category in NAMESPACE_SHORTCUTS) { - var select = $('<select><option>' + category + '</option></select>').appendTo($('.namespace-shortcuts')); - for(var ns in NAMESPACE_SHORTCUTS[category]) { - select.append('<option value="' + NAMESPACE_SHORTCUTS[category][ns] + '">' + ns + '</option>'); - } -} + $('.namespace-shortcuts select').change(function() { + var uri = this.value; + var tab = $(this).parents('.tab').attr('id').split('-')[0]; + var current = EDITORS[tab].getValue(); -$('.namespace-shortcuts select').change(function() { - var uri = this.value; - var tab = $(this).parents('.tab').attr('id').split('-')[0]; - var current = EDITORS[tab].getValue(); + if(current.indexOf(uri) == -1) { + var ns = $(this).find(':selected').text(); + EDITORS[tab].setValue('prefix ' + ns + ': <' + uri + '>\n' + current); + } - if(current.indexOf(uri) == -1) { - var ns = $(this).find(':selected').text(); - EDITORS[tab].setValue('prefix ' + ns + ': <' + uri + '>\n' + current); - } + // reselect group label + this.selectedIndex = 0; + }); +} - // reselect group label - this.selectedIndex = 0; -}); - /* Update */ function handleDragOver(cm, e) { @@ -466,9 +531,9 @@ if(extension == 'rq') { // SPARQL setType('sparql'); - } else if(extension in rdf_types) { + } else if(extension in RDF_TYPES) { // RDF - setType('rdf', rdf_types[extension]); + setType('rdf', RDF_TYPES[extension]); } else { // extension is no help, see if we can find some SPARQL commands setType(identify(content)); @@ -491,8 +556,8 @@ } text = text.toUpperCase(); - for(var i=0; i<sparql_update_commands.length; i++) { - if(text.indexOf(sparql_update_commands[i]) != -1) { + for(var i=0; i<SPARQL_UPDATE_COMMANDS.length; i++) { + if(text.indexOf(SPARQL_UPDATE_COMMANDS[i]) != -1) { return 'sparql'; } } @@ -516,9 +581,6 @@ setUpdateSettings(type); } -$('#update-type').change(function() { setUpdateSettings(this.value); }); -$('#rdf-type').change(function() { setUpdateMode('rdf'); }); - function setUpdateSettings(type) { $('#rdf-type, label[for="rdf-type"]').attr('disabled', type != 'rdf'); $('#update-tab .advanced-features input').attr('disabled', type != 'sparql'); @@ -531,63 +593,27 @@ mode = 'sparql'; } else if(type == 'rdf') { type = $('#rdf-type').val(); - if(type in rdf_modes) { - mode = rdf_modes[type]; + if(type in RDF_MODES) { + mode = RDF_MODES[type]; } } EDITORS.update.setOption('mode', mode); } -// .xml is used for both RDF and TriX, assume it's RDF -// We could check the parent element to see which it is -var rdf_types = {'nq': 'n-quads', - 'nt': 'n-triples', - 'n3': 'n3', - 'rdf': 'rdf/xml', - 'rdfs': 'rdf/xml', - 'owl': 'rdf/xml', - 'xml': 'rdf/xml', - 'json': 'json', - 'trig': 'trig', - 'trix': 'trix', - //'xml': 'trix', - 'ttl': 'turtle'}; - -var rdf_content_types = {'n-quads': 'text/x-nquads', - 'n-triples': 'text/plain', - 'n3': 'text/rdf+n3', - 'rdf/xml': 'application/rdf+xml', - 'json': 'application/sparql-results+json', - 'trig': 'application/x-trig', - 'trix': 'application/trix', - 'turtle': 'application/x-turtle'}; +function createUpdateEditor() { + EDITORS.update = CodeMirror.fromTextArea($('#update-box')[0], CODEMIRROR_DEFAULTS); + EDITORS.update.on('change', function() { + if(ERROR_LINE_MARKERS.update) { + ERROR_LINE_MARKERS.update.clear(); + ERROR_CHARACTER_MARKERS.update.clear(); + } + }); + EDITORS.update.on('dragover', handleDragOver); + EDITORS.update.on('drop', handleDrop); + EDITORS.update.on('paste', handlePaste); + EDITORS.update.addKeyMap({'Ctrl-Enter': submitUpdate}); +} -// key is value of RDF type selector, value is name of CodeMirror mode -var rdf_modes = {'n-triples': 'ntriples', 'rdf/xml': 'xml', 'json': 'json', 'turtle': 'turtle'}; - -var sparql_update_commands = ['INSERT', 'DELETE', 'LOAD', 'CLEAR']; - -$('#update-file').change(handleFileInput); -// $('#update-box').on('dragover', handleDragOver) -// .on('drop', handleFile) -// .on('paste', handlePaste) -// .on('input propertychange', function() { $('#update-errors').hide(); }); -$('#clear-file').click(clearFile); - -$('#update-update').click(submitUpdate); - -EDITORS.update = CodeMirror.fromTextArea($('#update-box')[0], CODEMIRROR_DEFAULTS); -EDITORS.update.on('change', function() { - if(ERROR_LINE_MARKERS.update) { - ERROR_LINE_MARKERS.update.clear(); - ERROR_CHARACTER_MARKERS.update.clear(); - } -}); -EDITORS.update.on('dragover', handleDragOver); -EDITORS.update.on('drop', handleDrop); -EDITORS.update.on('paste', handlePaste); -EDITORS.update.addKeyMap({'Ctrl-Enter': submitUpdate}); - function submitUpdate(e) { // Updates are submitted as a regular form for SPARQL updates in monitor mode, and via AJAX for non-monitor SPARQL, RDF & file path updates. // When submitted as a regular form, the output is sent to an iframe. This is to allow monitor mode to work. @@ -639,7 +665,7 @@ alert('Please select an RDF content type.'); return; } - settings.contentType = rdf_content_types[type]; + settings.contentType = RDF_CONTENT_TYPES[type]; break; case 'path': // if no scheme is specified, assume a local path @@ -655,16 +681,17 @@ $.ajax(url, settings); } -$('#update-clear').click(function() { +function clearUpdateOutput() { $('#update-response, #update-clear-container').hide(); $('#update-response pre').text(''); $('#update-response iframe').attr('src', 'about:blank'); -}); +} -$('.advanced-features-toggle').click(function() { +// also for query panel +function toggleAdvancedFeatures(e) { + e.preventDefault(); $(this).next('.advanced-features').toggle(); - return false; -}); +} function updateResponseHTML(data) { $('#update-response, #update-clear-container').show(); @@ -690,33 +717,31 @@ /* Query */ -$('#query-box').on('input propertychange', function() { $('#query-errors').hide(); }); -$('#query-form').submit(submitQuery); - -$('#query-explain').change(function() { +// details needs explain, so turn details off if explain is unchecked, +// and turn explain on if details is checked +function handleExplain() { if(!this.checked) { $('#query-details').prop('checked', false); } -}); +} -$('#query-details').change(function() { +function handleDetails() { if(this.checked) { $('#query-explain').prop('checked', true); } -}); +} -EDITORS.query = CodeMirror.fromTextArea($('#query-box')[0], CODEMIRROR_DEFAULTS); -EDITORS.query.on('change', function() { - if(ERROR_LINE_MARKERS.query) { - ERROR_LINE_MARKERS.query.clear(); - ERROR_CHARACTER_MARKERS.query.clear(); - } -}); -EDITORS.query.addKeyMap({'Ctrl-Enter': submitQuery}); +function createQueryEditor() { + EDITORS.query = CodeMirror.fromTextArea($('#query-box')[0], CODEMIRROR_DEFAULTS); + EDITORS.query.on('change', function() { + if(ERROR_LINE_MARKERS.query) { + ERROR_LINE_MARKERS.query.clear(); + ERROR_CHARACTER_MARKERS.query.clear(); + } + }); + EDITORS.query.addKeyMap({'Ctrl-Enter': submitQuery}); +} -$('#query-history').on('click', '.query a', loadHistory); -$('#query-history').on('click', '.query-delete a', deleteHistoryRow) - function loadHistory(e) { e.preventDefault(); EDITORS.query.setValue(this.innerText); @@ -805,49 +830,39 @@ } } -$('#query-response-clear').click(function() { +function clearQueryResponse() { $('#query-response, #query-explanation').empty(''); $('#query-response, #query-pagination, #query-explanation, #query-export-container').hide(); -}); +} -$('#query-export').click(function() { updateExportFileExtension(); showModal('query-export-modal'); }); +function showQueryExportModal() { + updateExportFileExtension(); + showModal('query-export-modal'); +} -var export_extensions = { - "application/rdf+xml": ['RDF/XML', 'rdf', true], - "application/n-triples": ['N-Triples', 'nt', true], - "application/x-turtle": ['Turtle', 'ttl', true], - "text/rdf+n3": ['N3', 'n3', true], - "application/trix": ['TriX', 'trix', true], - "application/x-trig": ['TRIG', 'trig', true], - "text/x-nquads": ['NQUADS', 'nq', true], +function createExportOptions() { + for(var contentType in EXPORT_EXTENSIONS) { + var optgroup = EXPORT_EXTENSIONS[contentType][2] ? '#rdf-formats' : '#non-rdf-formats'; + $(optgroup).append('<option value="' + contentType + '">' + EXPORT_EXTENSIONS[contentType][0] + '</option>'); + } - "text/csv": ['CSV', 'csv', false, exportCSV], - "application/sparql-results+json": ['JSON', 'json', false, exportJSON], - // "text/tab-separated-values": ['TSV', 'tsv', false, exportTSV], - "application/sparql-results+xml": ['XML', 'xml', false, exportXML] -}; + $('#export-format option:first').prop('selected', true); -for(var contentType in export_extensions) { - var optgroup = export_extensions[contentType][2] ? '#rdf-formats' : '#non-rdf-formats'; - $(optgroup).append('<option value="' + contentType + '">' + export_extensions[contentType][0] + '</option>'); + $('#export-format').change(updateExportFileExtension); } -$('#export-format option:first').prop('selected', true); - -$('#export-format').change(updateExportFileExtension); - function updateExportFileExtension() { - $('#export-filename-extension').html(export_extensions[$('#export-format').val()][1]); + $('#export-filename-extension').html(EXPORT_EXTENSIONS[$('#export-format').val()][1]); } -$('#query-download').click(function() { +function queryExport() { var dataType = $('#export-format').val(); var filename = $('#export-filename').val(); if(filename == '') { filename = 'export'; } - filename += '.' + export_extensions[dataType][1]; - if(export_extensions[dataType][2]) { + filename += '.' + EXPORT_EXTENSIONS[dataType][1]; + if(EXPORT_EXTENSIONS[dataType][2]) { // RDF var settings = { type: 'POST', @@ -860,10 +875,10 @@ $.ajax(RO_URL_PREFIX + 'sparql?workbench&convert', settings); } else { // not RDF - export_extensions[dataType][3](filename); + EXPORT_EXTENSIONS[dataType][3](filename); } $(this).siblings('.modal-cancel').click(); -}); +} function downloadRDFError(jqXHR, textStatus, errorThrown) { alert(jqXHR.statusText); @@ -935,7 +950,7 @@ $('#download-link').remove(); } -function updateresultCountAndExecutionTime(count) { +function updateResultCountAndExecutionTime(count) { $('#query-history tbody tr:first td.query-results').text(count); var ms = Date.now() - Date.parse($('#query-history tbody tr:first td.query-time').html()); @@ -987,7 +1002,7 @@ table.append(tr); } } - updateresultCountAndExecutionTime(rows.length); + updateResultCountAndExecutionTime(rows.length); } else { // JSON // save data for export and pagination @@ -996,7 +1011,7 @@ if(typeof(data.boolean) != 'undefined') { // ASK query table.append('<tr><td>' + data.boolean + '</td></tr>').addClass('boolean'); - updateresultCountAndExecutionTime('' + data.boolean); + updateResultCountAndExecutionTime('' + data.boolean); return; } @@ -1038,7 +1053,7 @@ table.append(thead); $('#total-results').html(data.results.bindings.length); - updateresultCountAndExecutionTime(data.results.bindings.length); + updateResultCountAndExecutionTime(data.results.bindings.length); setNumberOfPages(); showPage(1); @@ -1070,8 +1085,9 @@ } } -/* Pagination */ +/* Query result pagination */ + function setNumberOfPages() { TOTAL_PAGES = Math.ceil(QUERY_RESULTS.results.bindings.length / PAGE_SIZE); $('#result-pages').html(TOTAL_PAGES); @@ -1093,10 +1109,7 @@ showPage(1); } -$('#results-per-page').change(function() { setPageSize(this.value); }); -$('#previous-page').click(function() { showPage(CURRENT_PAGE - 1); }); -$('#next-page').click(function() { showPage(CURRENT_PAGE + 1); }); -$('#current-page').keyup(function(e) { +function handlePageSelector(e) { if(e.which == 13) { var n = parseInt(this.value, 10); if(typeof n != 'number' || n % 1 != 0 || n < 1 || n > TOTAL_PAGES) { @@ -1105,7 +1118,7 @@ showPage(n); } } -}); +} function showPage(n) { if(typeof n != 'number' || n % 1 != 0 || n < 1 || n > TOTAL_PAGES) { @@ -1162,9 +1175,10 @@ $('#current-page').val(n); } + /* Explore */ -$('#explore-form').submit(function(e) { +function exploreSubmit(e) { e.preventDefault(); var uri = $(this).find('input[type="text"]').val().trim(); if(uri) { @@ -1186,7 +1200,6 @@ loadURI(uri); // if this is a SID, make the components clickable - // var re = /<< *(<[^<>]*>) *(<[^<>]*>) *(<[^<>]*>) *>>/; var re = /<< *([^ ]+) +([^ ]+) +([^ ]+) *>>/; var match = uri.match(re); if(match) { @@ -1201,7 +1214,7 @@ $('#explore-header').html($('<h1>').text(uri)); } } -}); +} function buildExploreHash(uri) { return '#explore:' + NAMESPACE + ':' + uri; @@ -1367,10 +1380,6 @@ return hash.match(re); } -// handle history buttons and initial display of first tab -window.addEventListener("popstate", handlePopState); -$(handlePopState); - function handlePopState() { var hash = parseHash(this.location.hash); if(!hash) { @@ -1390,10 +1399,9 @@ $('#explore-results, #explore-header').show(); } + /* Status */ -$('#tab-selector a[data-target=status]').click(getStatus); - function getStatus(e) { if(e) { e.preventDefault(); @@ -1412,16 +1420,6 @@ $('p:contains(Show queries, query details)').find('a').eq(1).click(function(e) { e.preventDefault(); showQueries(true); }); } -$('#show-queries').click(function(e) { - e.preventDefault(); - showQueries(false); -}); - -$('#show-query-details').click(function(e) { - e.preventDefault(); - showQueries(true); -}); - function showQueries(details) { var url = RO_URL_PREFIX + 'status?showQueries'; if(details) { @@ -1500,10 +1498,9 @@ }); } + /* Health */ -$('#tab-selector a[data-target=health], #health-refresh').click(getHealth); - function getHealth(e) { e.preventDefault(); $.get('/status?health', function(data) { @@ -1552,12 +1549,10 @@ } }); } -showHealthTab(); + /* Performance */ -$('#tab-selector a[data-target=performance]').click(loadPerformance); - function loadPerformance(path) { if(typeof(path) == 'undefined') { path = ''; @@ -1588,6 +1583,7 @@ return '<' + uri + '>'; } +// currently unused function unabbreviate(uri) { if(uri.charAt(0) == '<') { // not abbreviated @@ -1598,6 +1594,7 @@ return '<' + uri.replace(namespace, NAMESPACE_SHORTCUTS[namespace]) + '>'; } +// currently unused function parseSID(sid) { // var re = /<< <([^<>]*)> <([^<>]*)> <([^<>]*)> >>/; var re = /<< *([^ ]+) +([^ ]+) +([^ ]+) *>>/; @@ -1609,4 +1606,83 @@ return $('<div/>').text(text).html(); } + +/* Startup functions */ + +function setupHandlers() { + // debug to access closure variables + $('html, textarea, select').bind('keydown', 'ctrl+d', function() { debugger; }); + + $('.use-lbs').change(useLBS); + + $('.modal-cancel').click(closeModal); + + $('#search-form').submit(submitSearch); + + $('#tab-selector a').click(clickTab); + // these should be , and . but Hotkeys views those keypresses as these characters + $('html, textarea, select').bind('keydown', 'ctrl+¼', moveTabLeft); + $('html, textarea, select').bind('keydown', 'ctrl+¾', moveTabRight); + $('#tab-selector a[data-target=status]').click(getStatus); + $('#tab-selector a[data-target=health], #health-refresh').click(getHealth); + $('#tab-selector a[data-target=performance]').click(loadPerformance); + + $('#new-namespace-mode').change(changeNamespaceMode); + $('#namespace-create').submit(createNamespace); + + $('#update-type').change(function() { setUpdateSettings(this.value); }); + $('#rdf-type').change(function() { setUpdateMode('rdf'); }); + $('#update-file').change(handleFileInput); + // $('#update-box').on('dragover', handleDragOver) + // .on('drop', handleFile) + // .on('paste', handlePaste) + // .on('input propertychange', function() { $('#update-errors').hide(); }); + $('#clear-file').click(clearFile); + $('#update-update').click(submitUpdate); + $('#update-clear').click(clearUpdateOutput); + + $('.advanced-features-toggle').click(toggleAdvancedFeatures); + + $('#query-box').on('input propertychange', function() { $('#query-errors').hide(); }); + $('#query-form').submit(submitQuery); + $('#query-explain').change(handleExplain); + $('#query-details').change(handleDetails); + $('#query-history').on('click', '.query a', loadHistory); + $('#query-history').on('click', '.query-delete a', deleteHistoryRow) + $('#query-response-clear').click(clearQueryResponse); + $('#query-export').click(showQueryExportModal); + $('#query-download').click(queryExport); + + $('#results-per-page').change(function() { setPageSize(this.value); }); + $('#previous-page').click(function() { showPage(CURRENT_PAGE - 1); }); + $('#next-page').click(function() { showPage(CURRENT_PAGE + 1); }); + $('#current-page').keyup(handlePageSelector); + + $('#explore-form').submit(exploreSubmit); + + // handle browser history buttons and initial display of first tab + window.addEventListener("popstate", handlePopState); + $(handlePopState); +} + +function startup() { + setupHandlers(); + + useLBS(true); + + showHealthTab(); + + getDefaultNamespace(); + + createNamespaceShortcuts(); + + createUpdateEditor(); + + createQueryEditor(); + + createExportOptions(); +} + +startup(); + }); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tho...@us...> - 2014-07-19 14:34:15
|
Revision: 8581 http://sourceforge.net/p/bigdata/code/8581 Author: thompsonbry Date: 2014-07-19 14:34:10 +0000 (Sat, 19 Jul 2014) Log Message: ----------- Added a copy of the tests for forward, reverse, and undirected traversal to the bigdata specific GASEngine test suite (they were already present in the openrdf version of the test suite). The tests all pass. Modified Paths: -------------- branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/graph/impl/bd/TestBFS.java Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/graph/impl/bd/TestBFS.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/graph/impl/bd/TestBFS.java 2014-07-19 00:10:57 UTC (rev 8580) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/graph/impl/bd/TestBFS.java 2014-07-19 14:34:10 UTC (rev 8581) @@ -23,10 +23,13 @@ */ package com.bigdata.rdf.graph.impl.bd; +import org.openrdf.sail.SailConnection; + import com.bigdata.rdf.graph.IGASContext; import com.bigdata.rdf.graph.IGASEngine; import com.bigdata.rdf.graph.IGASState; import com.bigdata.rdf.graph.IGraphAccessor; +import com.bigdata.rdf.graph.TraversalDirectionEnum; import com.bigdata.rdf.graph.analytics.BFS; /** @@ -93,4 +96,230 @@ } + /** + * Variant test in which we choose a vertex (<code>foaf:person</code>) in + * the middle of the graph and insist on forward directed edges. Since the + * edges point from the person to the <code>foaf:person</code> vertex, this + * BSF traversal does not discover any connected vertices. + */ + public void testBFS_directed_forward() throws Exception { + + final SmallGraphProblem p = setupSmallGraphProblem(); + + final IGASEngine gasEngine = getGraphFixture() + .newGASEngine(1/* nthreads */); + + try { + + final SailConnection cxn = getGraphFixture().getSail() + .getConnection(); + + try { + + final IGraphAccessor graphAccessor = getGraphFixture() + .newGraphAccessor(cxn); + + final IGASContext<BFS.VS, BFS.ES, Void> gasContext = gasEngine + .newGASContext(graphAccessor, new BFS()); + + final IGASState<BFS.VS, BFS.ES, Void> gasState = gasContext + .getGASState(); + + // Initialize the froniter. + gasState.setFrontier(gasContext, p.getFoafPerson()); + + // directed traversal. + gasContext + .setTraversalDirection(TraversalDirectionEnum.Forward); + + // Converge. + gasContext.call(); + + // starting vertex at (0,null). + assertEquals(0, gasState.getState(p.getFoafPerson()).depth()); + assertEquals(null, gasState.getState(p.getFoafPerson()) + .predecessor()); + + // no other vertices are visited. + assertEquals(-1, gasState.getState(p.getMike()).depth()); + assertEquals(null, gasState.getState(p.getMike()).predecessor()); + + assertEquals(-1, gasState.getState(p.getBryan()).depth()); + assertEquals(null, gasState.getState(p.getBryan()) + .predecessor()); + + assertEquals(-1, gasState.getState(p.getMartyn()).depth()); + assertEquals(null, gasState.getState(p.getMartyn()) + .predecessor()); + + } finally { + + try { + cxn.rollback(); + } finally { + cxn.close(); + } + + } + + } finally { + + gasEngine.shutdownNow(); + + } + + } + + /** + * Variant test in which we choose a vertex (<code>foaf:person</code>) in + * the middle of the graph and insist on reverse directed edges. Since the + * edges point from the person to the <code>foaf:person</code> vertex, + * forward BSF traversal does not discover any connected vertices. However, + * since the traversal direction is reversed, the vertices are all one hop + * away. + */ + public void testBFS_directed_reverse() throws Exception { + + final SmallGraphProblem p = setupSmallGraphProblem(); + + final IGASEngine gasEngine = getGraphFixture() + .newGASEngine(1/* nthreads */); + + try { + + final SailConnection cxn = getGraphFixture().getSail() + .getConnection(); + + try { + + final IGraphAccessor graphAccessor = getGraphFixture() + .newGraphAccessor(cxn); + + final IGASContext<BFS.VS, BFS.ES, Void> gasContext = gasEngine + .newGASContext(graphAccessor, new BFS()); + + final IGASState<BFS.VS, BFS.ES, Void> gasState = gasContext + .getGASState(); + + // Initialize the froniter. + gasState.setFrontier(gasContext, p.getFoafPerson()); + + // directed traversal. + gasContext + .setTraversalDirection(TraversalDirectionEnum.Reverse); + + // Converge. + gasContext.call(); + + // starting vertex at (0,null). + assertEquals(0, gasState.getState(p.getFoafPerson()).depth()); + assertEquals(null, gasState.getState(p.getFoafPerson()) + .predecessor()); + + // All other vertices are 1-hop. + assertEquals(1, gasState.getState(p.getMike()).depth()); + assertEquals(p.getFoafPerson(), gasState.getState(p.getMike()) + .predecessor()); + + assertEquals(1, gasState.getState(p.getBryan()).depth()); + assertEquals(p.getFoafPerson(), gasState.getState(p.getBryan()) + .predecessor()); + + assertEquals(1, gasState.getState(p.getMartyn()).depth()); + assertEquals(p.getFoafPerson(), gasState + .getState(p.getMartyn()).predecessor()); + + } finally { + + try { + cxn.rollback(); + } finally { + cxn.close(); + } + + } + + } finally { + + gasEngine.shutdownNow(); + + } + + } + + /** + * Variant test in which we choose a vertex (<code>foaf:person</code>) in + * the middle of the graph and insist on directed edges. Since the edges + * point from the person to the <code>foaf:person</code> vertex, this BSF + * traversal does not discover any connected vertices. + */ + public void testBFS_undirected() throws Exception { + + final SmallGraphProblem p = setupSmallGraphProblem(); + + final IGASEngine gasEngine = getGraphFixture() + .newGASEngine(1/* nthreads */); + + try { + + final SailConnection cxn = getGraphFixture().getSail() + .getConnection(); + + try { + + final IGraphAccessor graphAccessor = getGraphFixture() + .newGraphAccessor(cxn); + + final IGASContext<BFS.VS, BFS.ES, Void> gasContext = gasEngine + .newGASContext(graphAccessor, new BFS()); + + final IGASState<BFS.VS, BFS.ES, Void> gasState = gasContext + .getGASState(); + + // Initialize the froniter. + gasState.setFrontier(gasContext, p.getFoafPerson()); + + // undirected traversal. + gasContext + .setTraversalDirection(TraversalDirectionEnum.Undirected); + + // Converge. + gasContext.call(); + + // starting vertex at (0,null). + assertEquals(0, gasState.getState(p.getFoafPerson()).depth()); + assertEquals(null, gasState.getState(p.getFoafPerson()) + .predecessor()); + + // All other vertices are 1-hop. + assertEquals(1, gasState.getState(p.getMike()).depth()); + assertEquals(p.getFoafPerson(), gasState.getState(p.getMike()) + .predecessor()); + + assertEquals(1, gasState.getState(p.getBryan()).depth()); + assertEquals(p.getFoafPerson(), gasState.getState(p.getBryan()) + .predecessor()); + + assertEquals(1, gasState.getState(p.getMartyn()).depth()); + assertEquals(p.getFoafPerson(), gasState + .getState(p.getMartyn()).predecessor()); + + } finally { + + try { + cxn.rollback(); + } finally { + cxn.close(); + } + + } + + } finally { + + gasEngine.shutdownNow(); + + } + + } + } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tob...@us...> - 2014-07-19 00:11:01
|
Revision: 8580 http://sourceforge.net/p/bigdata/code/8580 Author: tobycraig Date: 2014-07-19 00:10:57 +0000 (Sat, 19 Jul 2014) Log Message: ----------- Fixed wrong identifier for details label in query advanced features Modified Paths: -------------- branches/BIGDATA_RELEASE_1_3_0/bigdata-war/src/html/index.html Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata-war/src/html/index.html =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-war/src/html/index.html 2014-07-18 18:13:26 UTC (rev 8579) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-war/src/html/index.html 2014-07-19 00:10:57 UTC (rev 8580) @@ -97,7 +97,7 @@ <div class="advanced-features"> <input type="checkbox" id="query-explain"> <label for="query-explain">Explain</label> - <input type="checkbox" id="query-details"> <label for="query-explain">(Details)</label> + <input type="checkbox" id="query-details"> <label for="query-details">(Details)</label> <input type="checkbox" name="analytic" value="true" id="query-analytic"> <label for="query-analytic">Analytic</label> <input type="checkbox" name="RTO" value="true" id="query-rto"> <label for="query-rto">Runtime Query Optimizer</label> <input type="checkbox" id="use-lbs-query" class="use-lbs"> <label for="use-lbs-query">LBS</label> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mrp...@us...> - 2014-07-18 18:13:33
|
Revision: 8579 http://sourceforge.net/p/bigdata/code/8579 Author: mrpersonick Date: 2014-07-18 18:13:26 +0000 (Fri, 18 Jul 2014) Log Message: ----------- Ticket 995: Better SPARQL support through BigdataGraph, plus some hardening and usability refinements. Forgot to check in test directory, broke the build. Modified Paths: -------------- branches/BIGDATA_RELEASE_1_3_0/bigdata-blueprints/src/test/com/bigdata/blueprints/AbstractTestBigdataGraph.java branches/BIGDATA_RELEASE_1_3_0/bigdata-blueprints/src/test/com/bigdata/blueprints/TestBigdataGraphEmbedded.java Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata-blueprints/src/test/com/bigdata/blueprints/AbstractTestBigdataGraph.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-blueprints/src/test/com/bigdata/blueprints/AbstractTestBigdataGraph.java 2014-07-18 15:45:57 UTC (rev 8578) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-blueprints/src/test/com/bigdata/blueprints/AbstractTestBigdataGraph.java 2014-07-18 18:13:26 UTC (rev 8579) @@ -22,11 +22,9 @@ */ package com.bigdata.blueprints; -import java.io.File; -import java.lang.reflect.Method; -import java.util.Arrays; -import java.util.LinkedHashMap; -import java.util.List; +import java.util.ArrayList; +import java.util.Date; +import java.util.HashMap; import java.util.Map; import java.util.Properties; @@ -35,21 +33,19 @@ import com.bigdata.rdf.axioms.NoAxioms; import com.bigdata.rdf.sail.AbstractBigdataSailTestCase; import com.bigdata.rdf.sail.BigdataSail; -import com.bigdata.rdf.sail.BigdataSailRepository; import com.bigdata.rdf.vocab.NoVocabulary; -import com.tinkerpop.blueprints.Contains; import com.tinkerpop.blueprints.Edge; import com.tinkerpop.blueprints.EdgeTestSuite; +import com.tinkerpop.blueprints.Element; import com.tinkerpop.blueprints.Graph; import com.tinkerpop.blueprints.GraphQueryTestSuite; import com.tinkerpop.blueprints.GraphTestSuite; -import com.tinkerpop.blueprints.KeyIndexableGraph; import com.tinkerpop.blueprints.TestSuite; import com.tinkerpop.blueprints.Vertex; import com.tinkerpop.blueprints.VertexQueryTestSuite; import com.tinkerpop.blueprints.VertexTestSuite; import com.tinkerpop.blueprints.impls.GraphTest; -import com.tinkerpop.blueprints.util.io.graphml.GraphMLReader; +import com.tinkerpop.blueprints.util.io.MockSerializable; /** */ @@ -164,7 +160,8 @@ test.doTestSuite(new GraphQueryTestSuite(test)); GraphTest.printTestPerformance("GraphQueryTestSuite", test.stopWatch()); } -// + + // public void testTransactionalGraphTestSuite() throws Exception { // final GraphTest test = newBigdataGraphTest(); // test.stopWatch(); @@ -184,78 +181,15 @@ // // } -// private static class BigdataTestSuite extends TestSuite { -// -// public BigdataTestSuite(final BigdataGraphTest graphTest) { -// super(graphTest); -// } -// -// public void testGraphQueryForHasOR() { -// Graph graph = graphTest.generateGraph(); -// if (graph.getFeatures().supportsEdgeIndex && graph instanceof KeyIndexableGraph) { -// ((KeyIndexableGraph) graph).createKeyIndex("type", Edge.class); -// } -// if (graph.getFeatures().supportsEdgeIteration && graph.getFeatures().supportsEdgeProperties && graph.getFeatures().supportsVertexProperties) { -// Vertex marko = graph.addVertex(null); -// marko.setProperty("name", "marko"); -// Vertex matthias = graph.addVertex(null); -// matthias.setProperty("name", "matthias"); -// Vertex stephen = graph.addVertex(null); -// stephen.setProperty("name", "stephen"); -// -// Edge edge = marko.addEdge("knows", stephen); -// edge.setProperty("type", "tinkerpop"); -// edge.setProperty("weight", 1.0); -// edge = marko.addEdge("knows", matthias); -// edge.setProperty("type", "aurelius"); -// -// assertEquals(count(graph.query().has("type", Contains.IN, Arrays.asList("tinkerpop", "aurelius")).edges()), 2); -// assertEquals(count(graph.query().has("type", Contains.IN, Arrays.asList("tinkerpop", "aurelius")).has("type", "tinkerpop").edges()), 1); -// assertEquals(count(graph.query().has("type", Contains.IN, Arrays.asList("tinkerpop", "aurelius")).has("type", "tinkerpop").has("type", "aurelius").edges()), 0); -// assertEquals(graph.query().has("weight").edges().iterator().next().getProperty("type"), "tinkerpop"); -// assertEquals(graph.query().has("weight").edges().iterator().next().getProperty("weight"), 1.0); -// assertEquals(graph.query().hasNot("weight").edges().iterator().next().getProperty("type"), "aurelius"); -// assertNull(graph.query().hasNot("weight").edges().iterator().next().getProperty("weight")); -// -// List result = asList(graph.query().has("name", Contains.IN, Arrays.asList("marko", "stephen")).vertices()); -// for (Object o : result) { -// final Vertex v = (Vertex) o; -// log.trace(v.getProperty("name")); -// } -// assertEquals(result.size(), 2); -// assertTrue(result.contains(marko)); -// assertTrue(result.contains(stephen)); -// result = asList(graph.query().has("name", Contains.IN, Arrays.asList("marko", "stephen", "matthias", "josh", "peter")).vertices()); -// assertEquals(result.size(), 3); -// assertTrue(result.contains(marko)); -// assertTrue(result.contains(stephen)); -// assertTrue(result.contains(matthias)); -// result = asList(graph.query().has("name").vertices()); -// assertEquals(result.size(), 3); -// assertTrue(result.contains(marko)); -// assertTrue(result.contains(stephen)); -// assertTrue(result.contains(matthias)); -// result = asList(graph.query().hasNot("name").vertices()); -// assertEquals(result.size(), 0); -// result = asList(graph.query().hasNot("blah").vertices()); -// assertEquals(result.size(), 3); -// assertTrue(result.contains(marko)); -// assertTrue(result.contains(stephen)); -// assertTrue(result.contains(matthias)); -// result = asList(graph.query().has("name", Contains.NOT_IN, Arrays.asList("bill", "sam")).vertices()); -// assertEquals(result.size(), 3); -// assertTrue(result.contains(marko)); -// assertTrue(result.contains(stephen)); -// assertTrue(result.contains(matthias)); -// result = asList(graph.query().has("name", Contains.IN, Arrays.asList("bill", "matthias", "stephen", "marko")).vertices()); -// assertEquals(result.size(), 3); -// assertTrue(result.contains(marko)); -// assertTrue(result.contains(stephen)); -// assertTrue(result.contains(matthias)); -// } -// graph.shutdown(); -// } -// } + private static class BigdataTestSuite extends TestSuite { + + public BigdataTestSuite(final GraphTest graphTest) { + super(graphTest); + } + + + + } // // // private class BigdataGraphTest extends GraphTest { Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata-blueprints/src/test/com/bigdata/blueprints/TestBigdataGraphEmbedded.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-blueprints/src/test/com/bigdata/blueprints/TestBigdataGraphEmbedded.java 2014-07-18 15:45:57 UTC (rev 8578) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-blueprints/src/test/com/bigdata/blueprints/TestBigdataGraphEmbedded.java 2014-07-18 18:13:26 UTC (rev 8579) @@ -24,7 +24,10 @@ import java.io.File; import java.lang.reflect.Method; +import java.util.ArrayList; import java.util.Arrays; +import java.util.Date; +import java.util.HashMap; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; @@ -35,12 +38,14 @@ import com.bigdata.rdf.sail.BigdataSail; import com.bigdata.rdf.sail.BigdataSailRepository; import com.tinkerpop.blueprints.Edge; +import com.tinkerpop.blueprints.Element; import com.tinkerpop.blueprints.Graph; import com.tinkerpop.blueprints.TestSuite; import com.tinkerpop.blueprints.TransactionalGraph; import com.tinkerpop.blueprints.TransactionalGraphTestSuite; import com.tinkerpop.blueprints.Vertex; import com.tinkerpop.blueprints.impls.GraphTest; +import com.tinkerpop.blueprints.util.io.MockSerializable; import com.tinkerpop.blueprints.util.io.graphml.GraphMLReader; /** @@ -78,12 +83,12 @@ //} -// public void testGetEdgesByLabel() throws Exception { +// public void testDataTypeValidationOnProperties() throws Exception { // final BigdataGraphTest test = new BigdataGraphTest(); // test.stopWatch(); // final BigdataTestSuite testSuite = new BigdataTestSuite(test); // try { -// testSuite.testGetEdgesByLabel(); +// testSuite.testDataTypeValidationOnProperties(); // } finally { // test.shutdown(); // } @@ -96,28 +101,125 @@ super(graphTest); } - public void testGetEdgesByLabel() { - Graph graph = graphTest.generateGraph(); - if (graph.getFeatures().supportsEdgeIteration) { - Vertex v1 = graph.addVertex(null); - Vertex v2 = graph.addVertex(null); - Vertex v3 = graph.addVertex(null); - - Edge e1 = graph.addEdge(null, v1, v2, graphTest.convertLabel("test1")); - Edge e2 = graph.addEdge(null, v2, v3, graphTest.convertLabel("test2")); - Edge e3 = graph.addEdge(null, v3, v1, graphTest.convertLabel("test3")); - - assertEquals(e1, getOnlyElement(graph.query().has("label", graphTest.convertLabel("test1")).edges())); - assertEquals(e2, getOnlyElement(graph.query().has("label", graphTest.convertLabel("test2")).edges())); - assertEquals(e3, getOnlyElement(graph.query().has("label", graphTest.convertLabel("test3")).edges())); - - assertEquals(e1, getOnlyElement(graph.getEdges("label", graphTest.convertLabel("test1")))); - assertEquals(e2, getOnlyElement(graph.getEdges("label", graphTest.convertLabel("test2")))); - assertEquals(e3, getOnlyElement(graph.getEdges("label", graphTest.convertLabel("test3")))); + public void testDataTypeValidationOnProperties() { + + final Graph graph = graphTest.generateGraph(); + if (graph.getFeatures().supportsElementProperties() && !graph.getFeatures().isWrapper) { + final Vertex vertexA = graph.addVertex(null); + final Vertex vertexB = graph.addVertex(null); + final Edge edge = graph.addEdge(null, vertexA, vertexB, graphTest.convertLabel("knows")); + + trySetProperty(vertexA, "keyString", "value", graph.getFeatures().supportsStringProperty); + trySetProperty(edge, "keyString", "value", graph.getFeatures().supportsStringProperty); + + trySetProperty(vertexA, "keyInteger", 100, graph.getFeatures().supportsIntegerProperty); + trySetProperty(edge, "keyInteger", 100, graph.getFeatures().supportsIntegerProperty); + + trySetProperty(vertexA, "keyLong", 10000L, graph.getFeatures().supportsLongProperty); + trySetProperty(edge, "keyLong", 10000L, graph.getFeatures().supportsLongProperty); + + trySetProperty(vertexA, "keyDouble", 100.321d, graph.getFeatures().supportsDoubleProperty); + trySetProperty(edge, "keyDouble", 100.321d, graph.getFeatures().supportsDoubleProperty); + + trySetProperty(vertexA, "keyFloat", 100.321f, graph.getFeatures().supportsFloatProperty); + trySetProperty(edge, "keyFloat", 100.321f, graph.getFeatures().supportsFloatProperty); + + trySetProperty(vertexA, "keyBoolean", true, graph.getFeatures().supportsBooleanProperty); + trySetProperty(edge, "keyBoolean", true, graph.getFeatures().supportsBooleanProperty); + + System.err.println("supportsSerializableObjectProperty" + graph.getFeatures().supportsSerializableObjectProperty); + trySetProperty(vertexA, "keyDate", new Date(), graph.getFeatures().supportsSerializableObjectProperty); + trySetProperty(edge, "keyDate", new Date(), graph.getFeatures().supportsSerializableObjectProperty); + + final ArrayList<String> listA = new ArrayList<String>(); + listA.add("try1"); + listA.add("try2"); + + trySetProperty(vertexA, "keyListString", listA, graph.getFeatures().supportsUniformListProperty); + trySetProperty(edge, "keyListString", listA, graph.getFeatures().supportsUniformListProperty); + + + tryGetProperty(vertexA, "keyListString", listA, graph.getFeatures().supportsUniformListProperty); + tryGetProperty(edge, "keyListString", listA, graph.getFeatures().supportsUniformListProperty); + + + final ArrayList listB = new ArrayList(); + listB.add("try1"); + listB.add(2); + + trySetProperty(vertexA, "keyListMixed", listB, graph.getFeatures().supportsMixedListProperty); + trySetProperty(edge, "keyListMixed", listB, graph.getFeatures().supportsMixedListProperty); + + tryGetProperty(vertexA, "keyListString", listA, graph.getFeatures().supportsMixedListProperty); + tryGetProperty(edge, "keyListString", listA, graph.getFeatures().supportsMixedListProperty); + + + trySetProperty(vertexA, "keyArrayString", new String[]{"try1", "try2"}, graph.getFeatures().supportsPrimitiveArrayProperty); + trySetProperty(edge, "keyArrayString", new String[]{"try1", "try2"}, graph.getFeatures().supportsPrimitiveArrayProperty); + + trySetProperty(vertexA, "keyArrayInteger", new int[]{1, 2}, graph.getFeatures().supportsPrimitiveArrayProperty); + trySetProperty(edge, "keyArrayInteger", new int[]{1, 2}, graph.getFeatures().supportsPrimitiveArrayProperty); + + trySetProperty(vertexA, "keyArrayLong", new long[]{1000l, 2000l}, graph.getFeatures().supportsPrimitiveArrayProperty); + trySetProperty(edge, "keyArrayLong", new long[]{1000l, 2000l}, graph.getFeatures().supportsPrimitiveArrayProperty); + + trySetProperty(vertexA, "keyArrayFloat", new float[]{1000.321f, 2000.321f}, graph.getFeatures().supportsPrimitiveArrayProperty); + trySetProperty(edge, "keyArrayFloat", new float[]{1000.321f, 2000.321f}, graph.getFeatures().supportsPrimitiveArrayProperty); + + trySetProperty(vertexA, "keyArrayDouble", new double[]{1000.321d, 2000.321d}, graph.getFeatures().supportsPrimitiveArrayProperty); + trySetProperty(edge, "keyArrayDouble", new double[]{1000.321d, 2000.321d}, graph.getFeatures().supportsPrimitiveArrayProperty); + + trySetProperty(vertexA, "keyArrayBoolean", new boolean[]{false, true}, graph.getFeatures().supportsPrimitiveArrayProperty); + trySetProperty(edge, "keyArrayBoolean", new boolean[]{false, true}, graph.getFeatures().supportsPrimitiveArrayProperty); + + trySetProperty(vertexA, "keyArrayEmpty", new int[0], graph.getFeatures().supportsPrimitiveArrayProperty); + trySetProperty(edge, "keyArrayEmpty", new int[0], graph.getFeatures().supportsPrimitiveArrayProperty); + + final Map map = new HashMap(); + map.put("testString", "try"); + map.put("testInteger", "string"); + + trySetProperty(vertexA, "keyMap", map, graph.getFeatures().supportsMapProperty); + trySetProperty(edge, "keyMap", map, graph.getFeatures().supportsMapProperty); + + final MockSerializable mockSerializable = new MockSerializable(); + mockSerializable.setTestField("test"); + trySetProperty(vertexA, "keySerializable", mockSerializable, graph.getFeatures().supportsSerializableObjectProperty); + trySetProperty(edge, "keySerializable", mockSerializable, graph.getFeatures().supportsSerializableObjectProperty); + } + + graph.shutdown(); } + + private void trySetProperty(final Element element, final String key, final Object value, final boolean allowDataType) { + boolean exceptionTossed = false; + try { + element.setProperty(key, value); + } catch (Throwable t) { + exceptionTossed = true; + if (!allowDataType) { + assertTrue(t instanceof IllegalArgumentException); + } else { + fail("setProperty should not have thrown an exception as this data type is accepted according to the GraphTest settings.\n\n" + + "Exception was " + t); + } + } + if (!allowDataType && !exceptionTossed) { + fail("setProperty threw an exception but the data type should have been accepted."); + } + } + private void tryGetProperty(final Element element, final String key, final Object value, final boolean allowDataType) { + + if (allowDataType) { + assertEquals(element.getProperty(key), value); + } + } + + + } @@ -254,7 +356,7 @@ { // create a persistent instance - final BigdataGraph graph = BigdataGraphFactory.create(jnl.getAbsolutePath()); + final BigdataGraph graph = BigdataGraphFactory.open(jnl.getAbsolutePath(), true); GraphMLReader.inputGraph(graph, TestBigdataGraphEmbedded.class.getResourceAsStream("graph-example-1.xml")); @@ -279,7 +381,7 @@ { // re-open the persistent instance - final BigdataGraph graph = BigdataGraphFactory.open(jnl.getAbsolutePath()); + final BigdataGraph graph = BigdataGraphFactory.open(jnl.getAbsolutePath(), true); System.err.println("persistent graph re-opened."); System.err.println("graph:"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tho...@us...> - 2014-07-18 15:46:00
|
Revision: 8578 http://sourceforge.net/p/bigdata/code/8578 Author: thompsonbry Date: 2014-07-18 15:45:57 +0000 (Fri, 18 Jul 2014) Log Message: ----------- Checkpoint on GIST refactor (#585) in support of group commit for the REST API (#566). This commit introduces hierarchical locking (vs enumeration of the indices) into the AbstractApiTask and makes some progress toward a refactor of the ITask interface and the AbstractTask implementation to support access at the ICheckpointProtocol layer (supports BTree, HTree and Stream) in addition to the IIndex layer (supports BTree, FusedView, and IsolatedFusedView). The next step will be to refactor AbstractTask.getIndex() to push down a method to obtaining the ICheckpointProtocol object. In order to do this, the AbstractTask.indexCache must be relayered. It is currently specific to the IIndex interface. In order to provide caching for ICheckpointProtocol objects, it needs to be rewritten to the ICheckpointProtocol layer. However, the code needs to be carefully reviewed to determine whether we also need caching at the IIndex layer or if we can only cache at the ICheckpointProtocol layer. This is a question of both correctness and performance. Modified Paths: -------------- branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/journal/AbstractTask.java branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/journal/ITask.java branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/java/com/bigdata/rdf/task/AbstractApiTask.java Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/journal/AbstractTask.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/journal/AbstractTask.java 2014-07-18 15:44:45 UTC (rev 8577) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/journal/AbstractTask.java 2014-07-18 15:45:57 UTC (rev 8578) @@ -56,6 +56,7 @@ import com.bigdata.bfs.GlobalFileSystemHelper; import com.bigdata.btree.AbstractBTree; import com.bigdata.btree.BTree; +import com.bigdata.btree.Checkpoint; import com.bigdata.btree.ICheckpointProtocol; import com.bigdata.btree.IDirtyListener; import com.bigdata.btree.IIndex; @@ -64,6 +65,7 @@ import com.bigdata.btree.view.FusedView; import com.bigdata.concurrent.NonBlockingLockManager; import com.bigdata.counters.CounterSet; +import com.bigdata.htree.AbstractHTree; import com.bigdata.mdi.IResourceMetadata; import com.bigdata.rawstore.IAllocationContext; import com.bigdata.rawstore.IPSOutputStream; @@ -114,9 +116,6 @@ * {@link ConcurrencyManager#submit(AbstractTask)} it. * * @author <a href="mailto:tho...@us...">Bryan Thompson</a> - * - * @todo declare generic type for the return as <? extends Object> to be compatible - * with {@link ConcurrencyManager#submit(AbstractTask)} */ public abstract class AbstractTask<T> implements Callable<T>, ITask<T> { @@ -264,6 +263,7 @@ * Cache of named indices resolved by this task for its {@link #timestamp}. * * @see #getIndex(String name) + * @see #getIndexLocal(String) */ final private Map<String,ILocalBTreeView> indexCache; @@ -543,8 +543,7 @@ } /** - * Return a view of the named index appropriate for the timestamp associated - * with this task. + * {@inheritDoc} * <p> * Note: There are two ways in which a task may access an * {@link ITx#UNISOLATED} index, but in all cases access to the index is @@ -553,37 +552,13 @@ * {@link IJournal#getIndex(String)} on that journal, which is simply * delegated to this method. See {@link IsolatedActionJournal}. * - * @param name - * The name of the index. - * - * @throws NullPointerException - * if <i>name</i> is <code>null</code>. - * @throws IllegalStateException - * if <i>name</i> is not a declared resource. - * @throws StaleLocatorException - * if <i>name</i> identifies an index partition which has been - * split, joined, or moved. - * @throws NoSuchIndexException - * if the named index is not registered as of the timestamp. - * - * @return The index. - * - * @todo modify to return <code>null</code> if the index is not registered? - * - * FIXME GIST. This will throw a ClassCastException if the returned - * index is an ILocalBTreeView. - * * @see http://trac.bigdata.com/ticket/585 (GIST) */ @Override synchronized final public ILocalBTreeView getIndex(final String name) { - if (name == null) { - - // @todo change to IllegalArgumentException for API consistency? + if (name == null) throw new NullPointerException(); - - } // validate that this is a declared index. assertResource(name); @@ -636,10 +611,11 @@ * index from the store, set the [lastCommitTime], and enter it into * the unisolated Name2Addr's cache of unisolated indices. */ - BTree btree; + ICheckpointProtocol ndx; // the unisolated name2Addr object. - final Name2Addr name2Addr = resourceManager.getLiveJournal()._getName2Addr(); + final Name2Addr name2Addr = resourceManager.getLiveJournal() + ._getName2Addr(); synchronized (name2Addr) { @@ -680,46 +656,61 @@ * But, fetch the btree from the cache to ensure we use the * most recent checkpoint */ - btree = null; + ndx = null; - final BTree tmpbtree = (BTree) name2Addr.getIndexCache(name); - if (tmpbtree != null) - checkpointAddr = tmpbtree.getCheckpoint().getCheckpointAddr(); + final ICheckpointProtocol tmp_ndx = name2Addr + .getIndexCache(name); + + if (tmp_ndx != null) { + + checkpointAddr = tmp_ndx.getCheckpoint() + .getCheckpointAddr(); + + } } else { - // recover from unisolated index cache. - btree = (BTree) name2Addr.getIndexCache(name); + + // Recover from unisolated index cache. + ndx = name2Addr.getIndexCache(name); + } - if (btree == null) { + if (ndx == null) { - final IJournal tmp; -// tmp = resourceManager.getLiveJournal(); - tmp = getJournal();// wrap with the IsolatedActionJournal. + // wrap with the IsolatedActionJournal. + final IJournal tmp = getJournal(); +// tmp = resourceManager.getLiveJournal(); // re-load btree from the store. - btree = BTree.load(// + ndx = Checkpoint.loadFromCheckpoint(// tmp, // backing store. checkpointAddr,// false// readOnly ); // set the lastCommitTime on the index. - btree.setLastCommitTime(entry.commitTime); + ndx.setLastCommitTime(entry.commitTime); // add to the unisolated index cache (must not exist). - name2Addr.putIndexCache(name, btree, false/* replace */); + name2Addr.putIndexCache(name, ndx, false/* replace */); - btree.setBTreeCounters(resourceManager - .getIndexCounters(name)); + // set performance counters iff the class supports it. + if (ndx instanceof AbstractBTree) { + ((AbstractBTree) ndx).setBTreeCounters(resourceManager + .getIndexCounters(name)); + } else if (ndx instanceof AbstractHTree) { + ((AbstractHTree) ndx).setBTreeCounters(resourceManager + .getIndexCounters(name)); + } } } try { - - return getUnisolatedIndexView(name, btree); + + // wrap B+Tree as FusedView: FIXME GIST : BTree specific code path. + return getUnisolatedIndexView(name, (BTree) ndx); } catch (NoSuchStoreException ex) { @@ -760,10 +751,12 @@ /** * Given the name of an index and a {@link BTree}, obtain the view for all * source(s) described by the {@link BTree}s index partition metadata (if - * any), inserts that view into the {@link #indexCache}, and return the view. + * any), inserts that view into the {@link #indexCache}, and return the + * view. * <p> - * Note: This method is used both when registering a new index ({@link #registerIndex(String, BTree)}) - * and when reading an index view from the source ({@link #getIndex(String)}). + * Note: This method is used both when registering a new index ( + * {@link #registerIndex(String, BTree)}) and when reading an index view + * from the source ({@link #getIndex(String)}). * * @param name * The index name. Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/journal/ITask.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/journal/ITask.java 2014-07-18 15:44:45 UTC (rev 8577) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/journal/ITask.java 2014-07-18 15:45:57 UTC (rev 8578) @@ -98,7 +98,8 @@ String toString(); /** - * Return an appropriate view of the named index for the operation. + * Return an appropriate view of the named B+Tree that has the appropriate + * isolation level for the operation (non-GIST). * <p> * When the task is isolated by a transaction, then the index will be * isolated by the transaction using the appropriate isolation level. If the @@ -124,23 +125,63 @@ * * @return An appropriate view of the named index. * - * @exception NoSuchIndexException - * if the named index does not exist at the time that the - * operation is executed. + * @throws NullPointerException + * if <i>name</i> is <code>null</code>. + * @throws IllegalStateException + * if <i>name</i> is not a declared resource. + * @throws StaleLocatorException + * if <i>name</i> identifies an index partition which has been + * split, joined, or moved. + * @throws NoSuchIndexException + * if the named index is not registered as of the timestamp. * - * @exception StaleLocatorException - * if the named index does not exist at the time the - * operation is executed and the {@link IResourceManager} has - * information which indicates that the index partition has - * been split, joined or moved. + * TODO modify to return <code>null</code> if the index is not + * registered? + */ + IIndex getIndex(String name); // non-GIST + + /** + * Return an appropriate view of the named index for the operation (GIST). + * <p> + * This method MUST be used to access non-B+Tree data structures that do not + * (yet) support {@link FusedView} style transaction isolation. + * <p> + * This method MAY NOT be used to access data structures if the operation is + * isolated by a read-write transaction. + * <p> + * This method DOES NOT understand the ordered views used by scale-out. The + * {@link ICheckpointProtocol} interface returned by this method is a + * concrete durable GIST data structure with a specific commit record. It is + * NOT a {@link FusedView} or similar data structure assembled from an + * ordered array of indices. If this method is used for a GIST data + * structure it will ONLY return the {@link ICheckpointProtocol} and will + * not wrap it with a {@link FusedView}. (This is of practical importance + * only for scale-out which uses {@link FusedView}s to support the dynamic + * key range partitioning algorithm for the distributed B+Tree data + * structure.) * - * @exception IllegalStateException - * if the named index is not one of the resources declared to - * the constructor. + * @param name + * The index name. * - * @see IGISTLocalManager + * @return An appropriate view of the named index. + * + * @throws NullPointerException + * if <i>name</i> is <code>null</code>. + * @throws IllegalStateException + * if <i>name</i> is not a declared resource. + * @throws StaleLocatorException + * if <i>name</i> identifies an index partition which has been + * split, joined, or moved. + * @throws NoSuchIndexException + * if the named index is not registered as of the timestamp. + * @throws UnsupportedOperationException + * if the {@link ITask} is associated with a read-write + * transaction. + * + * TODO modify to return <code>null</code> if the index is not + * registered? */ - IIndex getIndex(String name); // non-GIST +// ICheckpointProtocol getIndexLocal(String name); // GIST /** * The object used to track events and times for the task. Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/java/com/bigdata/rdf/task/AbstractApiTask.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/java/com/bigdata/rdf/task/AbstractApiTask.java 2014-07-18 15:44:45 UTC (rev 8577) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/java/com/bigdata/rdf/task/AbstractApiTask.java 2014-07-18 15:45:57 UTC (rev 8578) @@ -24,8 +24,6 @@ */ package com.bigdata.rdf.task; -import java.util.HashSet; -import java.util.Set; import java.util.concurrent.Future; import java.util.concurrent.FutureTask; import java.util.concurrent.atomic.AtomicReference; @@ -314,24 +312,12 @@ * locks and will have exclusive access to the resources guarded by * those locks when they run. * - * FIXME GROUP COMMIT: The {@link AbstractTask} was written to - * require the exact set of resource lock declarations. However, for - * the REST API, we want to operate on all indices associated with a - * KB instance. This requires either: - * <p> - * (a) pre-resolving the names of those indices and passing them all - * into the AbstractTask; or - * <P> - * (b) allowing the caller to only declare the namespace and then to - * be granted access to all indices whose names are in that - * namespace. - * - * (b) is now possible with the fix to the Name2Addr prefix scan. - * - * Note: We also need to isolate any named solution sets in the - * namespace of the KB. Those will be discovered along with the - * indices, but they may require changes to {@link AbstractTask} - * for GIST support. + * FIXME GROUP COMMIT: The hierarchical locking mechanisms will fail + * on durable named solution sets because they use either HTree or + * Stream and AbstractTask does not yet support those durable data + * structures (it is still being refactored to support the + * ICheckpointProtocol rather than the BTree in its Name2Addr + * isolation logic). */ // Obtain the necessary locks for R/w access to KB indices. @@ -350,7 +336,8 @@ } /** - * Acquire the locks for the named indices associated with the specified KB. + * Return the set of locks that the task must acquire in order to operate on + * the specified namespace. * * @param indexManager * The {@link Journal}. @@ -360,52 +347,41 @@ * @return The locks for the named indices associated with that KB instance. * * @throws DatasetNotFoundException - * - * FIXME GROUP COMMIT : [This should be replaced by the use of - * the namespace and hierarchical locking support in - * AbstractTask.] This could fail to discover a recently create - * KB between the time when the KB is created and when the group - * commit for that create becomes visible. This data race exists - * because we are using [lastCommitTime] rather than the - * UNISOLATED view of the GRS. - * <p> - * Note: This data race MIGHT be closed by the default locator - * cache. If it records the new KB properties when they are - * created, then they should be visible. If they are not - * visible, then we have a data race. (But if it records them - * before the group commit for the KB create, then the actual KB - * indices will not be durable until the that group commit...). - * <p> - * Note: The problem can obviously be resolved by using the - * UNISOLATED index to obtain the KB properties, but that would - * serialize ALL updates. What we need is a suitable caching - * mechanism that (a) ensures that newly create KB instances are - * visible; and (b) has high concurrency for read-only requests - * for the properties for those KB instances. */ private static String[] getLocksForKB(final Journal indexManager, final String namespace) throws DatasetNotFoundException { - final long timestamp = indexManager.getLastCommitTime(); + /* + * Note: There are two possible approaches here. One is to explicitly + * enumerate the index names for the triple store. The other is to + * specify the namespace of the triple store and use hierarchical + * locking. + * + * This is now using hierarchical locking, so it just returns the + * namespace. + */ + return new String[]{namespace}; + +// final long timestamp = indexManager.getLastCommitTime(); +// +// final AbstractTripleStore tripleStore = (AbstractTripleStore) indexManager +// .getResourceLocator().locate(namespace, timestamp); +// +// if (tripleStore == null) +// throw new DatasetNotFoundException("Not found: namespace=" +// + namespace + ", timestamp=" +// + TimestampUtility.toString(timestamp)); +// +// final Set<String> lockSet = new HashSet<String>(); +// +// lockSet.addAll(tripleStore.getSPORelation().getIndexNames()); +// +// lockSet.addAll(tripleStore.getLexiconRelation().getIndexNames()); +// +// final String[] locks = lockSet.toArray(new String[lockSet.size()]); +// +// return locks; - final AbstractTripleStore tripleStore = (AbstractTripleStore) indexManager - .getResourceLocator().locate(namespace, timestamp); - - if (tripleStore == null) - throw new DatasetNotFoundException("Not found: namespace=" - + namespace + ", timestamp=" - + TimestampUtility.toString(timestamp)); - - final Set<String> lockSet = new HashSet<String>(); - - lockSet.addAll(tripleStore.getSPORelation().getIndexNames()); - - lockSet.addAll(tripleStore.getLexiconRelation().getIndexNames()); - - final String[] locks = lockSet.toArray(new String[lockSet.size()]); - - return locks; - } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tho...@us...> - 2014-07-18 15:44:53
|
Revision: 8577 http://sourceforge.net/p/bigdata/code/8577 Author: thompsonbry Date: 2014-07-18 15:44:45 +0000 (Fri, 18 Jul 2014) Log Message: ----------- Code cleanup (override annotation). Modified Paths: -------------- branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/journal/Journal.java Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/journal/Journal.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/journal/Journal.java 2014-07-18 15:44:30 UTC (rev 8576) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/journal/Journal.java 2014-07-18 15:44:45 UTC (rev 8577) @@ -2978,6 +2978,7 @@ * Always returns the {@link BTree} as the sole element of the array since * partitioned indices are not supported. */ + @Override public AbstractBTree[] getIndexSources(final String name, final long timestamp, final BTree btree) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tho...@us...> - 2014-07-18 15:44:36
|
Revision: 8576 http://sourceforge.net/p/bigdata/code/8576 Author: thompsonbry Date: 2014-07-18 15:44:30 +0000 (Fri, 18 Jul 2014) Log Message: ----------- Code cleanup. Note: ConcurrencyManager.getCounters() changed to no longer be synchronized(this). The getCounters() method is using the new pattern where a new CounterSet is created and populated for each call rather than being cached locally. For this new pattern, we do not need to have the synchronized keyword on the getCounters() method. Modified Paths: -------------- branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/journal/ConcurrencyManager.java branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/journal/IResourceManager.java Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/journal/ConcurrencyManager.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/journal/ConcurrencyManager.java 2014-07-18 15:42:47 UTC (rev 8575) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/journal/ConcurrencyManager.java 2014-07-18 15:44:30 UTC (rev 8576) @@ -1,3 +1,29 @@ +/** + +Copyright (C) SYSTAP, LLC 2006-2007. All rights reserved. + +Contact: + SYSTAP, LLC + 4501 Tower Road + Greensboro, NC 27410 + lic...@bi... + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; version 2 of the License. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ +/* + * Created on Oct 10, 2007 + */ package com.bigdata.journal; import java.util.Collection; @@ -86,27 +112,25 @@ * </dd> * * @author <a href="mailto:tho...@us...">Bryan Thompson</a> - * @version $Id$ */ public class ConcurrencyManager implements IConcurrencyManager { - final protected static Logger log = Logger.getLogger(ConcurrencyManager.class); + static final private Logger log = Logger.getLogger(ConcurrencyManager.class); // /** // * True iff the {@link #log} level is INFO or less. // */ // final protected static boolean INFO = log.isInfoEnabled(); - - /** - * True iff the {@link #log} level is DEBUG or less. - */ - final protected static boolean DEBUG = log.isDebugEnabled(); +// +// /** +// * True iff the {@link #log} level is DEBUG or less. +// */ +// final private static boolean DEBUG = log.isDebugEnabled(); /** * Options for the {@link ConcurrentManager}. * * @author <a href="mailto:tho...@us...">Bryan Thompson</a> - * @version $Id$ */ public static interface Options extends IServiceShutdown.Options { @@ -423,6 +447,7 @@ // // } + @Override public ILocalTransactionManager getTransactionManager() { assertOpen(); @@ -430,7 +455,8 @@ return transactionManager; } - + + @Override public IResourceManager getResourceManager() { assertOpen(); @@ -439,6 +465,7 @@ } + @Override public boolean isOpen() { return open; @@ -449,6 +476,7 @@ * Shutdown the thread pools (running tasks will run to completion, but no * new tasks will start). */ + @Override synchronized public void shutdown() { if(!isOpen()) return; @@ -552,6 +580,7 @@ * * @see #shutdown() */ + @Override public void shutdownNow() { if(!isOpen()) return; @@ -942,7 +971,6 @@ * the {@link ConcurrencyManager}. * * @author <a href="mailto:tho...@us...">Bryan Thompson</a> - * @version $Id$ */ public static interface IConcurrencyManagerCounters { @@ -977,7 +1005,6 @@ * Reports the elapsed time since the service was started. * * @author <a href="mailto:tho...@us...">Bryan Thompson</a> - * @version $Id$ */ private static class ServiceElapsedTimeInstrument extends Instrument<Long> { @@ -989,6 +1016,7 @@ } + @Override public void sample() { setValue(System.currentTimeMillis() - serviceStartTime); @@ -1000,11 +1028,13 @@ /** * Return the {@link CounterSet}. */ - synchronized public CounterSet getCounters() { + @Override +// synchronized + public CounterSet getCounters() { // if (countersRoot == null){ - CounterSet countersRoot = new CounterSet(); + final CounterSet countersRoot = new CounterSet(); // elapsed time since the service started (milliseconds). countersRoot.addCounter("elapsed", @@ -1114,6 +1144,7 @@ * @exception NullPointerException * if task null */ + @Override public <T> Future<T> submit(final AbstractTask<T> task) { assertOpen(); @@ -1191,7 +1222,7 @@ * @param task * The task. */ - private void journalOverextended(final AbstractTask task) { + private void journalOverextended(final AbstractTask<?> task) { final double overextension = getJournalOverextended(); @@ -1404,6 +1435,7 @@ * @exception RejectedExecutionException * if any task cannot be scheduled for execution */ + @Override public <T> List<Future<T>> invokeAll( final Collection<? extends AbstractTask<T>> tasks) throws InterruptedException { @@ -1501,6 +1533,7 @@ * @exception RejectedExecutionException * if any task cannot be scheduled for execution */ + @Override public List<Future> invokeAll( final Collection<? extends AbstractTask> tasks, final long timeout, final TimeUnit unit) throws InterruptedException { Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/journal/IResourceManager.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/journal/IResourceManager.java 2014-07-18 15:42:47 UTC (rev 8575) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/journal/IResourceManager.java 2014-07-18 15:44:30 UTC (rev 8576) @@ -296,16 +296,7 @@ */ public IBigdataFederation<?> getFederation(); -// /** -// * Return the ordered {@link UUID}[] of the physical {@link IDataService} -// * failover chain for the logical {@link IDataService} whose resources are -// * under management by this class. -// * -// * @deprecated This is not used right now and might go away. -// */ -// public UUID[] getDataServiceUUIDs(); - - /** + /** * Return the {@link BTreeCounters} for the named index. If none exist, then * a new instance is atomically created and returned to the caller. This * facilitates the reuse of the same {@link BTreeCounters} instance for all @@ -315,11 +306,6 @@ * The name of the index. * * @return The counters for that index and never <code>null</code>. - * - * FIXME GIST The HTree class and other durable data structures - * should also have published performance counters. This is the - * simplest for the HTree since it has a lot in common with the - * BTree. */ BTreeCounters getIndexCounters(final String name); // non-GIST This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tho...@us...> - 2014-07-18 15:42:57
|
Revision: 8575 http://sourceforge.net/p/bigdata/code/8575 Author: thompsonbry Date: 2014-07-18 15:42:47 +0000 (Fri, 18 Jul 2014) Log Message: ----------- code cleanup only (version, override tags) Modified Paths: -------------- branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/btree/IIndex.java branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/btree/ReadCommittedView.java branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/btree/data/IAbstractNodeData.java branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/btree/data/ILeafData.java branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/htree/AbstractHTree.java branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/htree/HTree.java branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/resources/IndexManager.java branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/resources/ResourceEvents.java branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/resources/StoreManager.java Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/btree/IIndex.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/btree/IIndex.java 2014-07-18 15:30:35 UTC (rev 8574) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/btree/IIndex.java 2014-07-18 15:42:47 UTC (rev 8575) @@ -43,7 +43,6 @@ * </p> * * @author <a href="mailto:tho...@us...">Bryan Thompson</a> - * @version $Id$ */ public interface IIndex extends ISimpleBTree, IAutoboxBTree, IRangeQuery, IIndexLocalCounter, ICounterSetAccess { Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/btree/ReadCommittedView.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/btree/ReadCommittedView.java 2014-07-18 15:30:35 UTC (rev 8574) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/btree/ReadCommittedView.java 2014-07-18 15:42:47 UTC (rev 8575) @@ -85,7 +85,6 @@ * (b) the lastCommitTime on the journal is changed. * * @author <a href="mailto:tho...@us...">Bryan Thompson</a> - * @version $Id$ */ private static class Basis { @@ -175,96 +174,112 @@ } + @Override public ICounter getCounter() { return getIndex().getCounter(); } + @Override public CounterSet getCounters() { return getIndex().getCounters(); } + @Override public IndexMetadata getIndexMetadata() { return getIndex().getIndexMetadata(); } + @Override public IResourceMetadata[] getResourceMetadata() { return getIndex().getResourceMetadata(); } + @Override public boolean contains(byte[] key) { return getIndex().contains(key); } + @Override public boolean contains(Object key) { return getIndex().contains(key); } + @Override public byte[] lookup(byte[] key) { return getIndex().lookup(key); } + @Override public Object lookup(Object key) { return getIndex().lookup(key); } + @Override public byte[] remove(byte[] key) { throw new UnsupportedOperationException(); } + @Override public Object remove(Object key) { throw new UnsupportedOperationException(); } + @Override public byte[] insert(byte[] key, byte[] value) { throw new UnsupportedOperationException(); } + @Override public Object insert(Object key, Object value) { throw new UnsupportedOperationException(); } + @Override public long rangeCount() { return getIndex().rangeCount(); } + @Override public long rangeCount(byte[] fromKey, byte[] toKey) { return getIndex().rangeCount(fromKey, toKey); } + @Override public long rangeCountExact(byte[] fromKey, byte[] toKey) { return getIndex().rangeCountExact(fromKey, toKey); } + @Override public long rangeCountExactWithDeleted(byte[] fromKey, byte[] toKey) { return getIndex().rangeCountExactWithDeleted(fromKey, toKey); @@ -282,12 +297,14 @@ * created. In order for newly committed state to be visible you must * request a new iterator. */ + @Override public ITupleIterator rangeIterator() { return getIndex().rangeIterator(); } + @Override public ITupleIterator rangeIterator(byte[] fromKey, byte[] toKey, int capacity, int flags, IFilter filterCtor) { @@ -296,6 +313,7 @@ } + @Override public ITupleIterator rangeIterator(byte[] fromKey, byte[] toKey) { return getIndex().rangeIterator(fromKey, toKey); @@ -307,6 +325,7 @@ * read-only contract for the procedures processed by this class. */ + @Override public void submit(byte[] fromKey, byte[] toKey, IKeyRangeIndexProcedure proc, IResultHandler handler) { @@ -314,12 +333,14 @@ } + @Override public Object submit(byte[] key, ISimpleIndexProcedure proc) { return getIndex().submit(key, proc); } + @Override public void submit(int fromIndex, int toIndex, byte[][] keys, byte[][] vals, AbstractKeyArrayIndexProcedureConstructor ctor, IResultHandler resultHandler) { @@ -328,30 +349,34 @@ } - public final BTreeCounters getBTreeCounters() { - - return getIndex().getBtreeCounters(); - - } +// public final BTreeCounters getBTreeCounters() { +// +// return getIndex().getBtreeCounters(); +// +// } + @Override public IBloomFilter getBloomFilter() { return getIndex().getBloomFilter(); } + @Override public BTree getMutableBTree() { return getIndex().getMutableBTree(); } + @Override public int getSourceCount() { return getIndex().getSourceCount(); } + @Override public AbstractBTree[] getSources() { return getIndex().getSources(); Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/btree/data/IAbstractNodeData.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/btree/data/IAbstractNodeData.java 2014-07-18 15:30:35 UTC (rev 8574) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/btree/data/IAbstractNodeData.java 2014-07-18 15:42:47 UTC (rev 8575) @@ -34,7 +34,6 @@ * Interface for low-level data access. * * @author <a href="mailto:tho...@us...">Bryan Thompson</a> - * @version $Id$ */ public interface IAbstractNodeData extends IDataRecordAccess { @@ -59,6 +58,7 @@ * @throws UnsupportedOperationException * unless {@link #isCoded()} returns <code>true</code>. */ + @Override AbstractFixedByteArrayBuffer data(); /** Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/btree/data/ILeafData.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/btree/data/ILeafData.java 2014-07-18 15:30:35 UTC (rev 8574) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/btree/data/ILeafData.java 2014-07-18 15:42:47 UTC (rev 8575) @@ -35,7 +35,6 @@ * Interface for low-level data access for the leaves of a B+-Tree. * * @author <a href="mailto:tho...@us...">Bryan Thompson</a> - * @version $Id$ */ public interface ILeafData extends IAbstractNodeData, IKeysData { @@ -124,6 +123,7 @@ /** * Return <code>true</code> iff the leaf maintains version timestamps. */ + @Override public boolean hasVersionTimestamps(); /** Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/htree/AbstractHTree.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/htree/AbstractHTree.java 2014-07-18 15:30:35 UTC (rev 8574) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/htree/AbstractHTree.java 2014-07-18 15:42:47 UTC (rev 8575) @@ -57,7 +57,6 @@ * Abstract base class for a persistence capable extensible hash tree. * * @author <a href="mailto:tho...@us...">Bryan Thompson</a> - * @version $Id$ */ abstract public class AbstractHTree implements ICounterSetAccess, ICheckpointProtocol, ISimpleTreeIndexAccess { Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/htree/HTree.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/htree/HTree.java 2014-07-18 15:30:35 UTC (rev 8574) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/htree/HTree.java 2014-07-18 15:42:47 UTC (rev 8575) @@ -68,14 +68,12 @@ * An mutable persistence capable extensible hash tree. * * @author <a href="mailto:tho...@us...">Bryan Thompson</a> - * @version $Id$ * * @see <a * href="A robust scheme for multilevel extendible hashing (2003)"> * A Robust Scheme for Multilevel Extendible Hashing </a> by Sven Helmer, * Thomas Neumann, Guido Moerkotte. ISCIS 2003: 220-227. * - * * TODO It should be possible to define an native int32 hash table in * parallel to the unsigned byte[] hash table simply by having an * alternative descent passing an int32 key all the way down and using the Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/resources/IndexManager.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/resources/IndexManager.java 2014-07-18 15:30:35 UTC (rev 8574) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/resources/IndexManager.java 2014-07-18 15:42:47 UTC (rev 8575) @@ -90,20 +90,18 @@ * stores) on an LRU basis by the {@link ResourceManager}. * * @author <a href="mailto:tho...@us...">Bryan Thompson</a> - * @version $Id$ */ abstract public class IndexManager extends StoreManager { /** * Logger. */ - protected static final Logger log = Logger.getLogger(IndexManager.class); + private static final Logger log = Logger.getLogger(IndexManager.class); /** * Options understood by the {@link IndexManager}. * * @author <a href="mailto:tho...@us...">Bryan Thompson</a> - * @version $Id$ */ public static interface Options extends StoreManager.Options { @@ -211,7 +209,6 @@ * Performance counters for the {@link IndexManager}. * * @author <a href="mailto:tho...@us...">Bryan Thompson</a> - * @version $Id$ */ public static interface IIndexManagerCounters { @@ -379,6 +376,7 @@ * * @see StoreManager#indexCacheLock */ + @Override protected long getIndexRetentionTime() { final long t = indexCache.getRetentionTime(); @@ -477,7 +475,6 @@ * Statistics about the {@link IndexSegment}s open in the cache. * * @author <a href="mailto:tho...@us...">Bryan Thompson</a> - * @version $Id$ */ public static class IndexSegmentStats { @@ -565,6 +562,7 @@ * partition split/move/join changes somehow outpace the cache size then * the client would see a {@link NoSuchIndexException} instead. */ + @Override public StaleLocatorReason getIndexPartitionGone(final String name) { return staleLocatorCache.get(name); @@ -934,6 +932,7 @@ } + @Override public AbstractBTree[] getIndexSources(final String name, final long timestamp) { @@ -980,6 +979,7 @@ } + @Override public AbstractBTree[] getIndexSources(final String name, final long timestamp, final BTree btree) { @@ -1870,6 +1870,7 @@ */ private Map<String/*name*/, BTreeCounters> mark = new HashMap<String, BTreeCounters>(); + @Override public BTreeCounters getIndexCounters(final String name) { if (name == null) Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/resources/ResourceEvents.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/resources/ResourceEvents.java 2014-07-18 15:30:35 UTC (rev 8574) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/resources/ResourceEvents.java 2014-07-18 15:42:47 UTC (rev 8575) @@ -83,7 +83,6 @@ * partition), etc}. * * @author <a href="mailto:tho...@us...">Bryan Thompson</a> - * @version $Id$ */ public class ResourceEvents { @@ -94,7 +93,7 @@ * discovered service in order to aggregate results from multiple * hosts in a scale-out solution. */ - protected static final Logger log = Logger.getLogger(ResourceEvents.class); + private static final Logger log = Logger.getLogger(ResourceEvents.class); // /** // * True iff the {@link #log} level is DEBUG or less. Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/resources/StoreManager.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/resources/StoreManager.java 2014-07-18 15:30:35 UTC (rev 8574) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/resources/StoreManager.java 2014-07-18 15:42:47 UTC (rev 8575) @@ -132,7 +132,6 @@ * {@link #getDataDirFreeSpace(File)} * * @author <a href="mailto:tho...@us...">Bryan Thompson</a> - * @version $Id$ */ abstract public class StoreManager extends ResourceEvents implements IResourceManager { @@ -140,13 +139,12 @@ /** * Logger. */ - protected static final Logger log = Logger.getLogger(StoreManager.class); + private static final Logger log = Logger.getLogger(StoreManager.class); /** * Options for the {@link StoreManager}. * * @author <a href="mailto:tho...@us...">Bryan Thompson</a> - * @version $Id$ */ public static interface Options extends com.bigdata.journal.Options { @@ -267,7 +265,6 @@ * Performance counters for the {@link StoreManager}. * * @author <a href="mailto:tho...@us...">Bryan Thompson</a> - * @version $Id$ */ public static interface IStoreManagerCounters { @@ -1351,10 +1348,10 @@ * then the {@link StoreManager} will be {@link StoreManager#shutdownNow()}. * * @author <a href="mailto:tho...@us...">Bryan Thompson</a> - * @version $Id$ */ private class Startup implements Runnable { + @Override public void run() { try { @@ -1885,6 +1882,7 @@ * remains <code>true</code> until either {@link #shutdown()} or * {@link #shutdownNow()} is invoked. */ + @Override public boolean isOpen() { return open.get(); @@ -1900,6 +1898,7 @@ // // } + @Override synchronized public void shutdown() { if (log.isInfoEnabled()) @@ -1944,6 +1943,7 @@ } + @Override synchronized public void shutdownNow() { if(log.isInfoEnabled()) @@ -1991,7 +1991,6 @@ * Helper class gathers statistics about files during a scan. * * @author <a href="mailto:tho...@us...">Bryan Thompson</a> - * @version $Id$ */ private static class Stats { @@ -2077,7 +2076,8 @@ } - private void scanFile(File file, Stats stats) throws InterruptedException { + private void scanFile(final File file, final Stats stats) + throws InterruptedException { if (Thread.interrupted()) throw new InterruptedException(); @@ -2229,6 +2229,7 @@ } + @Override public File getTmpDir() { return tmpDir; @@ -2238,6 +2239,7 @@ /** * Note: The returned {@link File} is in canonical form. */ + @Override public File getDataDir() { return dataDir; @@ -2476,7 +2478,6 @@ * * @author <a href="mailto:tho...@us...">Bryan * Thompson</a> - * @version $Id$ */ public class ManagedJournal extends AbstractJournal { @@ -2516,6 +2517,7 @@ } + @Override public String toString() { /* @@ -2721,25 +2723,26 @@ } @Override - public ScheduledFuture<?> addScheduledTask(Runnable task, - long initialDelay, long delay, TimeUnit unit) { - return getFederation().addScheduledTask(task, initialDelay, delay, unit); - } + public ScheduledFuture<?> addScheduledTask(Runnable task, + long initialDelay, long delay, TimeUnit unit) { + return getFederation().addScheduledTask(task, initialDelay, delay, + unit); + } @Override - public boolean getCollectPlatformStatistics() { - return getFederation().getCollectPlatformStatistics(); - } + public boolean getCollectPlatformStatistics() { + return getFederation().getCollectPlatformStatistics(); + } @Override - public boolean getCollectQueueStatistics() { - return getFederation().getCollectQueueStatistics(); - } + public boolean getCollectQueueStatistics() { + return getFederation().getCollectQueueStatistics(); + } @Override - public int getHttpdPort() { - return getFederation().getHttpdPort(); - } + public int getHttpdPort() { + return getFederation().getHttpdPort(); + } } // class ManagedJournal @@ -2751,6 +2754,7 @@ * @throws IllegalStateException * if the {@link StoreManager} is still starting up. */ + @Override public ManagedJournal getLiveJournal() { assertRunning(); @@ -2798,6 +2802,7 @@ * (there should not be since we do a commit when we register the * indices on the new store). */ + @Override public AbstractJournal getJournal(final long timestamp) { assertRunning(); @@ -2870,6 +2875,7 @@ * something goes wrong (except that I was planning to drop the file * name from that interface). */ + @Override public IRawStore openStore(final UUID uuid) { assertRunning(); @@ -3103,6 +3109,7 @@ } + @Override public void deleteResources() { assertNotOpen(); @@ -4582,6 +4589,7 @@ } + @Override public File getIndexSegmentFile(final IndexMetadata indexMetadata) { if (indexMetadata == null) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mrp...@us...> - 2014-07-18 15:30:41
|
Revision: 8574 http://sourceforge.net/p/bigdata/code/8574 Author: mrpersonick Date: 2014-07-18 15:30:35 +0000 (Fri, 18 Jul 2014) Log Message: ----------- Ticket 995: Better SPARQL support through BigdataGraph, plus some hardening and usability refinements. Modified Paths: -------------- branches/BIGDATA_RELEASE_1_3_0/bigdata-blueprints/src/java/com/bigdata/blueprints/BigdataEdge.java branches/BIGDATA_RELEASE_1_3_0/bigdata-blueprints/src/java/com/bigdata/blueprints/BigdataElement.java branches/BIGDATA_RELEASE_1_3_0/bigdata-blueprints/src/java/com/bigdata/blueprints/BigdataGraph.java branches/BIGDATA_RELEASE_1_3_0/bigdata-blueprints/src/java/com/bigdata/blueprints/BigdataGraphBulkLoad.java branches/BIGDATA_RELEASE_1_3_0/bigdata-blueprints/src/java/com/bigdata/blueprints/BigdataGraphClient.java branches/BIGDATA_RELEASE_1_3_0/bigdata-blueprints/src/java/com/bigdata/blueprints/BigdataGraphConfiguration.java branches/BIGDATA_RELEASE_1_3_0/bigdata-blueprints/src/java/com/bigdata/blueprints/BigdataGraphEmbedded.java branches/BIGDATA_RELEASE_1_3_0/bigdata-blueprints/src/java/com/bigdata/blueprints/BigdataGraphFactory.java branches/BIGDATA_RELEASE_1_3_0/bigdata-blueprints/src/java/com/bigdata/blueprints/BigdataGraphQuery.java branches/BIGDATA_RELEASE_1_3_0/bigdata-blueprints/src/java/com/bigdata/blueprints/BigdataPredicate.java branches/BIGDATA_RELEASE_1_3_0/bigdata-blueprints/src/java/com/bigdata/blueprints/BigdataRDFFactory.java branches/BIGDATA_RELEASE_1_3_0/bigdata-blueprints/src/java/com/bigdata/blueprints/BigdataVertex.java branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/BigdataSailFactory.java branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/BigdataValueReplacer.java Added Paths: ----------- branches/BIGDATA_RELEASE_1_3_0/bigdata-blueprints/src/java/com/bigdata/blueprints/BigdataGraphlet.java branches/BIGDATA_RELEASE_1_3_0/bigdata-blueprints/src/java/com/bigdata/blueprints/BigdataQueryProjection.java branches/BIGDATA_RELEASE_1_3_0/bigdata-blueprints/src/java/com/bigdata/blueprints/BigdataSelection.java branches/BIGDATA_RELEASE_1_3_0/bigdata-blueprints/src/java/com/bigdata/blueprints/BlueprintsValueFactory.java branches/BIGDATA_RELEASE_1_3_0/bigdata-blueprints/src/java/com/bigdata/blueprints/DefaultBlueprintsValueFactory.java branches/BIGDATA_RELEASE_1_3_0/bigdata-blueprints/src/java/com/bigdata/blueprints/ImmortalGraph.java Removed Paths: ------------- branches/BIGDATA_RELEASE_1_3_0/bigdata-blueprints/src/java/com/bigdata/blueprints/BlueprintsRDFFactory.java Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata-blueprints/src/java/com/bigdata/blueprints/BigdataEdge.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-blueprints/src/java/com/bigdata/blueprints/BigdataEdge.java 2014-07-17 22:45:00 UTC (rev 8573) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-blueprints/src/java/com/bigdata/blueprints/BigdataEdge.java 2014-07-18 15:30:35 UTC (rev 8574) @@ -24,10 +24,11 @@ import java.util.Arrays; import java.util.List; +import java.util.Set; +import org.apache.log4j.Logger; import org.openrdf.model.Statement; import org.openrdf.model.URI; -import org.openrdf.model.vocabulary.RDFS; import com.tinkerpop.blueprints.Direction; import com.tinkerpop.blueprints.Edge; @@ -42,6 +43,8 @@ */ public class BigdataEdge extends BigdataElement implements Edge { + private static final transient Logger log = Logger.getLogger(BigdataEdge.class); + private static final List<String> blacklist = Arrays.asList(new String[] { "id", "", "label" }); @@ -57,13 +60,19 @@ @Override public Object getId() { - return graph.factory.fromEdgeURI(uri); + if (log.isInfoEnabled()) + log.info("()"); + + return graph.factory.fromURI(uri); } @Override public void remove() { + if (log.isInfoEnabled()) + log.info("()"); + graph.removeEdge(this); } @@ -71,13 +80,19 @@ @Override public String getLabel() { - return (String) graph.getProperty(uri, RDFS.LABEL); + if (log.isInfoEnabled()) + log.info("()"); + + return (String) graph.getProperty(uri, graph.getValueFactory().getLabelURI()); } @Override public Vertex getVertex(final Direction dir) throws IllegalArgumentException { + if (log.isInfoEnabled()) + log.info("("+dir+")"); + if (dir == Direction.BOTH) { throw new IllegalArgumentException(); } @@ -85,7 +100,7 @@ final URI uri = (URI) (dir == Direction.OUT ? stmt.getSubject() : stmt.getObject()); - final String id = graph.factory.fromVertexURI(uri); + final String id = graph.factory.fromURI(uri); return graph.getVertex(id); @@ -94,6 +109,9 @@ @Override public void setProperty(final String prop, final Object val) { + if (log.isInfoEnabled()) + log.info("("+prop+", "+val+")"); + if (prop == null || blacklist.contains(prop)) { throw new IllegalArgumentException(); } @@ -112,4 +130,55 @@ } + @Override + public <T> T getProperty(final String prop) { + + if (log.isInfoEnabled()) + log.info("("+prop+")"); + + return super.getProperty(prop); + } + + @Override + public Set<String> getPropertyKeys() { + + if (log.isInfoEnabled()) + log.info("()"); + + return super.getPropertyKeys(); + + } + + @Override + public <T> T removeProperty(final String prop) { + + if (log.isInfoEnabled()) + log.info("("+prop+")"); + + return super.removeProperty(prop); + + } + +// @Override +// public void addProperty(final String prop, final Object val) { +// +// if (log.isInfoEnabled()) +// log.info("("+prop+", "+val+")"); +// +// super.addProperty(prop, val); +// +// } +// +// @Override +// public <T> List<T> getProperties(final String prop) { +// +// if (log.isInfoEnabled()) +// log.info("("+prop+")"); +// +// return super.getProperties(prop); +// +// } + + + } Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata-blueprints/src/java/com/bigdata/blueprints/BigdataElement.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-blueprints/src/java/com/bigdata/blueprints/BigdataElement.java 2014-07-17 22:45:00 UTC (rev 8573) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-blueprints/src/java/com/bigdata/blueprints/BigdataElement.java 2014-07-18 15:30:35 UTC (rev 8574) @@ -85,30 +85,30 @@ } - /** - * Simple extension for multi-valued properties. - */ - public void addProperty(final String prop, final Object val) { - - if (prop == null || blacklist.contains(prop)) { - throw new IllegalArgumentException(); - } - - graph.addProperty(uri, prop, val); - - } +// /** +// * Simple extension for multi-valued properties. +// */ +// public void addProperty(final String prop, final Object val) { +// +// if (prop == null || blacklist.contains(prop)) { +// throw new IllegalArgumentException(); +// } +// +// graph.addProperty(uri, prop, val); +// +// } +// +// /** +// * Simple extension for multi-valued properties. +// */ +// @SuppressWarnings("unchecked") +// public <T> List<T> getProperties(final String property) { +// +// return (List<T>) graph.getProperties(uri, property); +// +// } /** - * Simple extension for multi-valued properties. - */ - @SuppressWarnings("unchecked") - public <T> List<T> getProperties(final String property) { - - return (List<T>) graph.getProperties(uri, property); - - } - - /** * Generated code. */ @Override Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata-blueprints/src/java/com/bigdata/blueprints/BigdataGraph.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-blueprints/src/java/com/bigdata/blueprints/BigdataGraph.java 2014-07-17 22:45:00 UTC (rev 8573) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-blueprints/src/java/com/bigdata/blueprints/BigdataGraph.java 2014-07-18 15:30:35 UTC (rev 8574) @@ -24,28 +24,31 @@ import info.aduna.iteration.CloseableIteration; +import java.lang.reflect.Array; +import java.util.Collection; import java.util.Iterator; import java.util.LinkedHashSet; import java.util.LinkedList; import java.util.List; +import java.util.Properties; import java.util.Set; import java.util.UUID; +import org.apache.log4j.Logger; import org.openrdf.OpenRDFException; import org.openrdf.model.Literal; import org.openrdf.model.Statement; import org.openrdf.model.URI; import org.openrdf.model.Value; import org.openrdf.model.impl.StatementImpl; -import org.openrdf.model.impl.URIImpl; -import org.openrdf.model.vocabulary.RDF; -import org.openrdf.model.vocabulary.RDFS; import org.openrdf.query.GraphQueryResult; import org.openrdf.query.QueryLanguage; +import org.openrdf.query.TupleQuery; +import org.openrdf.query.TupleQueryResult; +import org.openrdf.query.parser.QueryParserUtil; import org.openrdf.repository.RepositoryConnection; import org.openrdf.repository.RepositoryResult; -import com.bigdata.rdf.store.BD; import com.tinkerpop.blueprints.Direction; import com.tinkerpop.blueprints.Edge; import com.tinkerpop.blueprints.Features; @@ -62,25 +65,64 @@ */ public abstract class BigdataGraph implements Graph { + private static final transient Logger log = Logger.getLogger(BigdataGraph.class); + + public interface Options { + + /** + * Allow multiple edges with the same edge id. Useful for assigning + * by-reference properties (e.g. vertex type). + */ + String LAX_EDGES = BigdataGraph.class.getName() + ".laxEdges"; + + } + /** + * URI used for typing elements. + */ + protected final URI TYPE; + + /** * URI used to represent a Vertex. */ - public static final URI VERTEX = new URIImpl(BD.NAMESPACE + "Vertex"); - + protected final URI VERTEX; + /** * URI used to represent a Edge. */ - public static final URI EDGE = new URIImpl(BD.NAMESPACE + "Edge"); - + protected final URI EDGE; + + /** + * URI used for labeling edges. + */ + protected final URI LABEL; + /** * Factory for round-tripping between Blueprints data and RDF data. */ - final BlueprintsRDFFactory factory; + final BlueprintsValueFactory factory; - public BigdataGraph(final BlueprintsRDFFactory factory) { + /** + * Allow re-use of edge identifiers. + */ + private final boolean laxEdges; + + public BigdataGraph(final BlueprintsValueFactory factory) { + this(factory, new Properties()); + } + + public BigdataGraph(final BlueprintsValueFactory factory, + final Properties props) { this.factory = factory; + this.laxEdges = Boolean.valueOf(props.getProperty(Options.LAX_EDGES, "false")); + + this.TYPE = factory.getTypeURI(); + this.VERTEX = factory.getVertexURI(); + this.EDGE = factory.getEdgeURI(); + this.LABEL = factory.getLabelURI(); + } /** @@ -93,13 +135,27 @@ } + /** + * Return the factory used to round-trip between Blueprints values and + * RDF values. + */ + public BlueprintsValueFactory getValueFactory() { + return factory; + } + /** * Different implementations will return different types of connections * depending on the mode (client/server, embedded, read-only, etc.) */ - protected abstract RepositoryConnection cxn() throws Exception; + protected abstract RepositoryConnection getWriteConnection() throws Exception; /** + * A read-only connection can be used for read operations without blocking + * or being blocked by writers. + */ + protected abstract RepositoryConnection getReadOnlyConnection() throws Exception; + + /** * Return a single-valued property for an edge or vertex. * * @see {@link BigdataElement} @@ -120,26 +176,38 @@ try { final RepositoryResult<Statement> result = - cxn().getStatements(uri, prop, null, false); + getWriteConnection().getStatements(uri, prop, null, false); if (result.hasNext()) { - final Value value = result.next().getObject(); - - if (result.hasNext()) { - throw new RuntimeException(uri - + ": more than one value for p: " + prop - + ", did you mean to call getProperties()?"); + final Statement stmt = result.next(); + + if (!result.hasNext()) { + + /* + * Single value. + */ + return getProperty(stmt.getObject()); + + } else { + + /* + * Multi-value, use a list. + */ + final List<Object> list = new LinkedList<Object>(); + + list.add(getProperty(stmt.getObject())); + + while (result.hasNext()) { + + list.add(getProperty(result.next().getObject())); + + } + + return list; + } - if (!(value instanceof Literal)) { - throw new RuntimeException("not a property: " + value); - } - - final Literal lit = (Literal) value; - - return factory.fromLiteral(lit); - } return null; @@ -152,56 +220,73 @@ } - /** - * Return a multi-valued property for an edge or vertex. - * - * @see {@link BigdataElement} - */ - public List<Object> getProperties(final URI uri, final String prop) { + protected Object getProperty(final Value value) { + + if (!(value instanceof Literal)) { + throw new RuntimeException("not a property: " + value); + } + + final Literal lit = (Literal) value; - return getProperties(uri, factory.toPropertyURI(prop)); + final Object o = factory.fromLiteral(lit); - } + return o; - - /** - * Return a multi-valued property for an edge or vertex. - * - * @see {@link BigdataElement} - */ - public List<Object> getProperties(final URI uri, final URI prop) { - - try { - - final RepositoryResult<Statement> result = - cxn().getStatements(uri, prop, null, false); - - final List<Object> props = new LinkedList<Object>(); - - while (result.hasNext()) { - - final Value value = result.next().getObject(); - - if (!(value instanceof Literal)) { - throw new RuntimeException("not a property: " + value); - } - - final Literal lit = (Literal) value; - - props.add(factory.fromLiteral(lit)); - - } - - return props; - - } catch (RuntimeException e) { - throw e; - } catch (Exception e) { - throw new RuntimeException(e); - } - } +// /** +// * Return a multi-valued property for an edge or vertex. +// * +// * TODO get rid of me +// * +// * @see {@link BigdataElement} +// */ +// public List<Object> getProperties(final URI uri, final String prop) { +// +// return getProperties(uri, factory.toPropertyURI(prop)); +// +// } +// +// /** +// * Return a multi-valued property for an edge or vertex. +// * +// * TODO get rid of me +// * +// * @see {@link BigdataElement} +// */ +// public List<Object> getProperties(final URI uri, final URI prop) { +// +// try { +// +// final RepositoryResult<Statement> result = +// getWriteConnection().getStatements(uri, prop, null, false); +// +// final List<Object> props = new LinkedList<Object>(); +// +// while (result.hasNext()) { +// +// final Value value = result.next().getObject(); +// +// if (!(value instanceof Literal)) { +// throw new RuntimeException("not a property: " + value); +// } +// +// final Literal lit = (Literal) value; +// +// props.add(factory.fromLiteral(lit)); +// +// } +// +// return props; +// +// } catch (RuntimeException e) { +// throw e; +// } catch (Exception e) { +// throw new RuntimeException(e); +// } +// +// } + /** * Return the property names for an edge or vertex. * @@ -212,7 +297,7 @@ try { final RepositoryResult<Statement> result = - cxn().getStatements(uri, null, null, false); + getWriteConnection().getStatements(uri, null, null, false); final Set<String> properties = new LinkedHashSet<String>(); @@ -224,12 +309,12 @@ continue; } - if (stmt.getPredicate().equals(RDFS.LABEL)) { + if (stmt.getPredicate().equals(LABEL)) { continue; } final String p = - factory.fromPropertyURI(stmt.getPredicate()); + factory.fromURI(stmt.getPredicate()); properties.add(p); @@ -267,7 +352,7 @@ final Object oldVal = getProperty(uri, prop); - cxn().remove(uri, prop, null); + getWriteConnection().remove(uri, prop, null); return oldVal; @@ -283,9 +368,54 @@ * * @see {@link BigdataElement} */ - public void setProperty(final URI uri, final String prop, final Object val) { + public void setProperty(final URI s, final String prop, final Object val) { + + if (val instanceof Collection) { + + @SuppressWarnings("unchecked") + final Collection<Object> vals = (Collection<Object>) val; + + // empty collection, do nothing + if (vals.size() == 0) { + return; + } + + final Collection<Literal> literals = new LinkedList<Literal>(); + + for (Object o : vals) { + + literals.add(factory.toLiteral(o)); + + } + + setProperty(s, factory.toPropertyURI(prop), literals); + + } else if (val.getClass().isArray()) { + + final int len = Array.getLength(val); + + // empty array, do nothing + if (len == 0) { + return; + } + + final Collection<Literal> literals = new LinkedList<Literal>(); + + for (int i = 0; i < len; i++) { + + final Object o = Array.get(val, i); + + literals.add(factory.toLiteral(o)); + + } + + setProperty(s, factory.toPropertyURI(prop), literals); + + } else { - setProperty(uri, factory.toPropertyURI(prop), factory.toLiteral(val)); + setProperty(s, factory.toPropertyURI(prop), factory.toLiteral(val)); + + } } @@ -298,11 +428,15 @@ public void setProperty(final URI uri, final URI prop, final Literal val) { try { + + final RepositoryConnection cxn = getWriteConnection(); + + // remove the old value + cxn.remove(uri, prop, null); + + // add the new value + cxn.add(uri, prop, val); - cxn().remove(uri, prop, null); - - cxn().add(uri, prop, val); - } catch (RuntimeException e) { throw e; } catch (Exception e) { @@ -312,27 +446,26 @@ } /** - * Add a property on an edge or vertex (multi-value property extension). + * Set a multi-value property on an edge or vertex (remove the old + * values first). * * @see {@link BigdataElement} */ - public void addProperty(final URI uri, final String prop, final Object val) { + public void setProperty(final URI uri, final URI prop, + final Collection<Literal> vals) { - setProperty(uri, factory.toPropertyURI(prop), factory.toLiteral(val)); + try { - } - - /** - * Add a property on an edge or vertex (multi-value property extension). - * - * @see {@link BigdataElement} - */ - public void addProperty(final URI uri, final URI prop, final Literal val) { - - try { + final RepositoryConnection cxn = getWriteConnection(); - cxn().add(uri, prop, val); + // remove the old value + cxn.remove(uri, prop, null); + // add the new values + for (Literal val : vals) { + cxn.add(uri, prop, val); + } + } catch (RuntimeException e) { throw e; } catch (Exception e) { @@ -341,6 +474,36 @@ } +// /** +// * Add a property on an edge or vertex (multi-value property extension). +// * +// * @see {@link BigdataElement} +// */ +// public void addProperty(final URI uri, final String prop, final Object val) { +// +// setProperty(uri, factory.toPropertyURI(prop), factory.toLiteral(val)); +// +// } +// +// /** +// * Add a property on an edge or vertex (multi-value property extension). +// * +// * @see {@link BigdataElement} +// */ +// public void addProperty(final URI uri, final URI prop, final Literal val) { +// +// try { +// +// getWriteConnection().add(uri, prop, val); +// +// } catch (RuntimeException e) { +// throw e; +// } catch (Exception e) { +// throw new RuntimeException(e); +// } +// +// } + /** * Post a GraphML file to the remote server. (Bulk-upload operation.) */ @@ -357,40 +520,44 @@ public Edge addEdge(final Object key, final Vertex from, final Vertex to, final String label) { + if (log.isInfoEnabled()) + log.info("("+key+", "+from+", "+to+", "+label+")"); + if (label == null) { throw new IllegalArgumentException(); } - final String eid = key != null ? key.toString() : UUID.randomUUID().toString(); - - final URI edgeURI = factory.toEdgeURI(eid); - - if (key != null) { + if (key != null && !laxEdges) { final Edge edge = getEdge(key); if (edge != null) { if (!(edge.getVertex(Direction.OUT).equals(from) && - (edge.getVertex(Direction.OUT).equals(to)))) { + (edge.getVertex(Direction.IN).equals(to)))) { throw new IllegalArgumentException("edge already exists: " + key); } } } + final String eid = key != null ? key.toString() : UUID.randomUUID().toString(); + + final URI edgeURI = factory.toEdgeURI(eid); + try { // do we need to check this? -// if (cxn().hasStatement(edgeURI, RDF.TYPE, EDGE, false)) { +// if (cxn().hasStatement(edgeURI, TYPE, EDGE, false)) { // throw new IllegalArgumentException("edge " + eid + " already exists"); // } final URI fromURI = factory.toVertexURI(from.getId().toString()); final URI toURI = factory.toVertexURI(to.getId().toString()); - cxn().add(fromURI, edgeURI, toURI); - cxn().add(edgeURI, RDF.TYPE, EDGE); - cxn().add(edgeURI, RDFS.LABEL, factory.toLiteral(label)); + final RepositoryConnection cxn = getWriteConnection(); + cxn.add(fromURI, edgeURI, toURI); + cxn.add(edgeURI, TYPE, EDGE); + cxn.add(edgeURI, LABEL, factory.toLiteral(label)); return new BigdataEdge(new StatementImpl(fromURI, edgeURI, toURI), this); @@ -408,6 +575,9 @@ @Override public Vertex addVertex(final Object key) { + if (log.isInfoEnabled()) + log.info("("+key+")"); + try { final String vid = key != null ? @@ -416,11 +586,11 @@ final URI uri = factory.toVertexURI(vid); // do we need to check this? -// if (cxn().hasStatement(vertexURI, RDF.TYPE, VERTEX, false)) { +// if (cxn().hasStatement(vertexURI, TYPE, VERTEX, false)) { // throw new IllegalArgumentException("vertex " + vid + " already exists"); // } - cxn().add(uri, RDF.TYPE, VERTEX); + getWriteConnection().add(uri, TYPE, VERTEX); return new BigdataVertex(uri, this); @@ -437,6 +607,9 @@ */ @Override public Edge getEdge(final Object key) { + + if (log.isInfoEnabled()) + log.info("("+key+")"); if (key == null) throw new IllegalArgumentException(); @@ -446,7 +619,7 @@ final URI edge = factory.toEdgeURI(key.toString()); final RepositoryResult<Statement> result = - cxn().getStatements(null, edge, null, false); + getWriteConnection().getStatements(null, edge, null, false); if (result.hasNext()) { @@ -477,6 +650,9 @@ @Override public Iterable<Edge> getEdges() { + if (log.isInfoEnabled()) + log.info("()"); + final URI wild = null; return getEdges(wild, wild); @@ -549,7 +725,7 @@ try { final org.openrdf.query.GraphQuery query = - cxn().prepareGraphQuery(QueryLanguage.SPARQL, queryStr); + getWriteConnection().prepareGraphQuery(QueryLanguage.SPARQL, queryStr); final GraphQueryResult stmts = query.evaluate(); @@ -576,7 +752,7 @@ try { final org.openrdf.query.GraphQuery query = - cxn().prepareGraphQuery(QueryLanguage.SPARQL, queryStr); + getWriteConnection().prepareGraphQuery(QueryLanguage.SPARQL, queryStr); final GraphQueryResult stmts = query.evaluate(); @@ -635,7 +811,7 @@ try { final org.openrdf.query.GraphQuery query = - cxn().prepareGraphQuery(QueryLanguage.SPARQL, queryStr); + getWriteConnection().prepareGraphQuery(QueryLanguage.SPARQL, queryStr); final GraphQueryResult stmts = query.evaluate(); @@ -663,6 +839,9 @@ @Override public Iterable<Edge> getEdges(final String prop, final Object val) { + if (log.isInfoEnabled()) + log.info("("+prop+", "+val+")"); + final URI p = factory.toPropertyURI(prop); final Literal o = factory.toLiteral(val); @@ -692,6 +871,9 @@ @Override public Vertex getVertex(final Object key) { + if (log.isInfoEnabled()) + log.info("("+key+")"); + if (key == null) throw new IllegalArgumentException(); @@ -699,7 +881,7 @@ try { - if (cxn().hasStatement(uri, RDF.TYPE, VERTEX, false)) { + if (getWriteConnection().hasStatement(uri, TYPE, VERTEX, false)) { return new BigdataVertex(uri, this); } @@ -720,10 +902,13 @@ @Override public Iterable<Vertex> getVertices() { + if (log.isInfoEnabled()) + log.info("()"); + try { final RepositoryResult<Statement> result = - cxn().getStatements(null, RDF.TYPE, VERTEX, false); + getWriteConnection().getStatements(null, TYPE, VERTEX, false); return new VertexIterable(result, true); @@ -741,13 +926,16 @@ @Override public Iterable<Vertex> getVertices(final String prop, final Object val) { + if (log.isInfoEnabled()) + log.info("("+prop+", "+val+")"); + final URI p = factory.toPropertyURI(prop); final Literal o = factory.toLiteral(val); try { final RepositoryResult<Statement> result = - cxn().getStatements(null, p, o, false); + getWriteConnection().getStatements(null, p, o, false); return new VertexIterable(result, true); @@ -765,6 +953,10 @@ */ @Override public GraphQuery query() { + + if (log.isInfoEnabled()) + log.info("()"); + // return new DefaultGraphQuery(this); return new BigdataGraphQuery(this); } @@ -779,17 +971,17 @@ final URI uri = factory.toURI(edge); - if (!cxn().hasStatement(uri, RDF.TYPE, EDGE, false)) { + if (!getWriteConnection().hasStatement(uri, TYPE, EDGE, false)) { throw new IllegalStateException(); } final URI wild = null; // remove the edge statement - cxn().remove(wild, uri, wild); + getWriteConnection().remove(wild, uri, wild); // remove its properties - cxn().remove(uri, wild, wild); + getWriteConnection().remove(uri, wild, wild); } catch (RuntimeException e) { throw e; @@ -809,17 +1001,17 @@ final URI uri = factory.toURI(vertex); - if (!cxn().hasStatement(uri, RDF.TYPE, VERTEX, false)) { + if (!getWriteConnection().hasStatement(uri, TYPE, VERTEX, false)) { throw new IllegalStateException(); } final URI wild = null; // remove outgoing edges and properties - cxn().remove(uri, wild, wild); + getWriteConnection().remove(uri, wild, wild); // remove incoming edges - cxn().remove(wild, wild, uri); + getWriteConnection().remove(wild, wild, uri); } catch (RuntimeException e) { throw e; @@ -1004,6 +1196,100 @@ } + /** + * Project a subgraph using a SPARQL query. + */ + public BigdataGraphlet project(final String queryStr) throws Exception { + + final String operation = + QueryParserUtil.removeSPARQLQueryProlog(queryStr).toLowerCase(); + + if (!operation.startsWith("construct")) { + throw new IllegalArgumentException("not a graph query"); + } + + try { + + final RepositoryConnection cxn = getReadOnlyConnection(); + + try { + + final org.openrdf.query.GraphQuery query = + cxn.prepareGraphQuery(QueryLanguage.SPARQL, queryStr); + + final GraphQueryResult result = query.evaluate(); + try { + + final BigdataQueryProjection projection = + new BigdataQueryProjection(factory); + + return projection.convert(result); + + } finally { + result.close(); + } + + } finally { + + cxn.close(); + + } + + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new RuntimeException(e); + } + + } + + /** + * Select results using a SPARQL query. + */ + public BigdataSelection select(final String queryStr) throws Exception { + + final String operation = + QueryParserUtil.removeSPARQLQueryProlog(queryStr).toLowerCase(); + + if (!operation.startsWith("select")) { + throw new IllegalArgumentException("not a tuple query"); + } + + try { + + final RepositoryConnection cxn = getReadOnlyConnection(); + + try { + + final TupleQuery query = (TupleQuery) + cxn.prepareTupleQuery(QueryLanguage.SPARQL, queryStr); + + final TupleQueryResult result = query.evaluate(); + try { + + final BigdataQueryProjection projection = + new BigdataQueryProjection(factory); + + return projection.convert(result); + + } finally { + result.close(); + } + + } finally { + + cxn.close(); + + } + + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new RuntimeException(e); + } + + } + protected static final Features FEATURES = new Features(); @Override @@ -1020,9 +1306,9 @@ FEATURES.supportsDoubleProperty = true; FEATURES.supportsFloatProperty = true; FEATURES.supportsIntegerProperty = true; - FEATURES.supportsPrimitiveArrayProperty = false; - FEATURES.supportsUniformListProperty = false; - FEATURES.supportsMixedListProperty = false; + FEATURES.supportsPrimitiveArrayProperty = true; + FEATURES.supportsUniformListProperty = true; + FEATURES.supportsMixedListProperty = true; FEATURES.supportsLongProperty = true; FEATURES.supportsMapProperty = false; FEATURES.supportsStringProperty = true; @@ -1034,7 +1320,7 @@ FEATURES.supportsEdgeIteration = true; FEATURES.supportsVertexIndex = false; FEATURES.supportsEdgeIndex = false; - FEATURES.ignoresSuppliedIds = true; + FEATURES.ignoresSuppliedIds = false; FEATURES.supportsTransactions = false; FEATURES.supportsIndices = true; FEATURES.supportsKeyIndices = true; @@ -1046,5 +1332,5 @@ FEATURES.supportsThreadedTransactions = false; } - + } Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata-blueprints/src/java/com/bigdata/blueprints/BigdataGraphBulkLoad.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-blueprints/src/java/com/bigdata/blueprints/BigdataGraphBulkLoad.java 2014-07-17 22:45:00 UTC (rev 8573) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-blueprints/src/java/com/bigdata/blueprints/BigdataGraphBulkLoad.java 2014-07-18 15:30:35 UTC (rev 8574) @@ -35,7 +35,6 @@ import com.bigdata.rdf.changesets.IChangeRecord; import com.bigdata.rdf.sail.BigdataSailRepositoryConnection; import com.tinkerpop.blueprints.Edge; -import com.tinkerpop.blueprints.Features; import com.tinkerpop.blueprints.GraphQuery; import com.tinkerpop.blueprints.TransactionalGraph; import com.tinkerpop.blueprints.Vertex; @@ -60,17 +59,21 @@ } public BigdataGraphBulkLoad(final BigdataSailRepositoryConnection cxn, - final BlueprintsRDFFactory factory) { + final BlueprintsValueFactory factory) { super(factory); this.cxn = cxn; this.cxn.addChangeLog(this); } - protected RepositoryConnection cxn() throws Exception { + protected RepositoryConnection getWriteConnection() throws Exception { return cxn; } + protected RepositoryConnection getReadOnlyConnection() throws Exception { + return cxn; + } + @Override public void commit() { try { @@ -167,7 +170,7 @@ // cxn().remove(s, p, null); - cxn().add(s, p, o); + getWriteConnection().add(s, p, o); } catch (Exception e) { throw new RuntimeException(e); @@ -193,7 +196,7 @@ // throw new IllegalArgumentException("vertex " + vid + " already exists"); // } - cxn().add(uri, RDF.TYPE, VERTEX); + getWriteConnection().add(uri, RDF.TYPE, VERTEX); return new BigdataVertex(uri, this); @@ -241,9 +244,9 @@ final URI fromURI = factory.toVertexURI(from.getId().toString()); final URI toURI = factory.toVertexURI(to.getId().toString()); - cxn().add(fromURI, edgeURI, toURI); - cxn().add(edgeURI, RDF.TYPE, EDGE); - cxn().add(edgeURI, RDFS.LABEL, factory.toLiteral(label)); + getWriteConnection().add(fromURI, edgeURI, toURI); + getWriteConnection().add(edgeURI, RDF.TYPE, EDGE); + getWriteConnection().add(edgeURI, RDFS.LABEL, factory.toLiteral(label)); return new BigdataEdge(new StatementImpl(fromURI, edgeURI, toURI), this); Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata-blueprints/src/java/com/bigdata/blueprints/BigdataGraphClient.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-blueprints/src/java/com/bigdata/blueprints/BigdataGraphClient.java 2014-07-17 22:45:00 UTC (rev 8573) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-blueprints/src/java/com/bigdata/blueprints/BigdataGraphClient.java 2014-07-18 15:30:35 UTC (rev 8574) @@ -54,7 +54,7 @@ } public BigdataGraphClient(final String bigdataEndpoint, - final BlueprintsRDFFactory factory) { + final BlueprintsValueFactory factory) { this(new BigdataSailRemoteRepository(bigdataEndpoint), factory); } @@ -63,7 +63,7 @@ } public BigdataGraphClient(final RemoteRepository repo, - final BlueprintsRDFFactory factory) { + final BlueprintsValueFactory factory) { this(new BigdataSailRemoteRepository(repo), factory); } @@ -72,7 +72,7 @@ } public BigdataGraphClient(final BigdataSailRemoteRepository repo, - final BlueprintsRDFFactory factory) { + final BlueprintsValueFactory factory) { super(factory); this.repo = repo; @@ -89,13 +89,21 @@ /** * Get a {@link BigdataSailRemoteRepositoryConnection}. */ - protected BigdataSailRemoteRepositoryConnection cxn() throws Exception { + protected BigdataSailRemoteRepositoryConnection getWriteConnection() throws Exception { if (cxn == null) { cxn = repo.getConnection(); } return cxn; } + /** + * Get a {@link BigdataSailRemoteRepositoryConnection}. No difference in + * connection for remote clients. + */ + protected BigdataSailRemoteRepositoryConnection getReadOnlyConnection() throws Exception { + return getWriteConnection(); + } + /** * Shutdown the connection and repository (client-side, not server-side). */ Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata-blueprints/src/java/com/bigdata/blueprints/BigdataGraphConfiguration.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-blueprints/src/java/com/bigdata/blueprints/BigdataGraphConfiguration.java 2014-07-17 22:45:00 UTC (rev 8573) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-blueprints/src/java/com/bigdata/blueprints/BigdataGraphConfiguration.java 2014-07-18 15:30:35 UTC (rev 8574) @@ -110,7 +110,7 @@ final String journal = config.getString(Options.FILE); - return BigdataGraphFactory.create(journal); + return BigdataGraphFactory.open(journal, true); } else { Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata-blueprints/src/java/com/bigdata/blueprints/BigdataGraphEmbedded.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-blueprints/src/java/com/bigdata/blueprints/BigdataGraphEmbedded.java 2014-07-17 22:45:00 UTC (rev 8573) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-blueprints/src/java/com/bigdata/blueprints/BigdataGraphEmbedded.java 2014-07-18 15:30:35 UTC (rev 8574) @@ -22,6 +22,8 @@ */ package com.bigdata.blueprints; +import java.util.Properties; + import org.openrdf.repository.RepositoryConnection; import com.bigdata.rdf.sail.BigdataSail; @@ -53,11 +55,11 @@ /** * Create a Blueprints wrapper around a {@link BigdataSail} instance with - * a non-standard {@link BlueprintsRDFFactory} implementation. + * a non-standard {@link BlueprintsValueFactory} implementation. */ public BigdataGraphEmbedded(final BigdataSail sail, - final BlueprintsRDFFactory factory) { - this(new BigdataSailRepository(sail), factory); + final BlueprintsValueFactory factory) { + this(new BigdataSailRepository(sail), factory, new Properties()); } /** @@ -65,20 +67,24 @@ * instance. */ public BigdataGraphEmbedded(final BigdataSailRepository repo) { - this(repo, BigdataRDFFactory.INSTANCE); + this(repo, BigdataRDFFactory.INSTANCE, new Properties()); } /** * Create a Blueprints wrapper around a {@link BigdataSailRepository} - * instance with a non-standard {@link BlueprintsRDFFactory} implementation. + * instance with a non-standard {@link BlueprintsValueFactory} implementation. */ public BigdataGraphEmbedded(final BigdataSailRepository repo, - final BlueprintsRDFFactory factory) { - super(factory); + final BlueprintsValueFactory factory, final Properties props) { + super(factory, props); this.repo = repo; } + public BigdataSailRepository getRepository() { + return repo; + } + protected final ThreadLocal<RepositoryConnection> cxn = new ThreadLocal<RepositoryConnection>() { protected RepositoryConnection initialValue() { RepositoryConnection cxn = null; @@ -92,7 +98,7 @@ } }; - protected RepositoryConnection cxn() throws Exception { + protected RepositoryConnection getWriteConnection() throws Exception { // if (cxn == null) { // cxn = repo.getUnisolatedConnection(); // cxn.setAutoCommit(false); @@ -100,6 +106,10 @@ return cxn.get(); } + protected RepositoryConnection getReadOnlyConnection() throws Exception { + return repo.getReadOnlyConnection(); + } + @Override public void commit() { try { Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata-blueprints/src/java/com/bigdata/blueprints/BigdataGraphFactory.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-blueprints/src/java/com/bigdata/blueprints/BigdataGraphFactory.java 2014-07-17 22:45:00 UTC (rev 8573) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-blueprints/src/java/com/bigdata/blueprints/BigdataGraphFactory.java 2014-07-18 15:30:35 UTC (rev 8574) @@ -63,10 +63,12 @@ } /** - * Open an existing persistent local bigdata instance. + * Open an existing persistent local bigdata instance. If a journal does + * not exist at the specified location and the boolean create flag is true + * a journal will be created at that location. */ - public static BigdataGraph open(final String file) throws Exception { - final BigdataSail sail = BigdataSailFactory.openSail(file); + public static BigdataGraph open(final String file, final boolean create) throws Exception { + final BigdataSail sail = BigdataSailFactory.openSail(file, create); sail.initialize(); return new BigdataGraphEmbedded(sail); } @@ -80,14 +82,14 @@ return new BigdataGraphEmbedded(sail); } - /** - * Create a new persistent local bigdata instance. - */ - public static BigdataGraph create(final String file) - throws Exception { - final BigdataSail sail = BigdataSailFactory.createSail(file); - sail.initialize(); - return new BigdataGraphEmbedded(sail); - } +// /** +// * Create a new persistent local bigdata instance. +// */ +// public static BigdataGraph create(final String file) +// throws Exception { +// final BigdataSail sail = BigdataSailFactory.createSail(file); +// sail.initialize(); +// return new BigdataGraphEmbedded(sail); +// } } Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata-blueprints/src/java/com/bigdata/blueprints/BigdataGraphQuery.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-blueprints/src/java/com/bigdata/blueprints/BigdataGraphQuery.java 2014-07-17 22:45:00 UTC (rev 8573) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-blueprints/src/java/com/bigdata/blueprints/BigdataGraphQuery.java 2014-07-18 15:30:35 UTC (rev 8574) @@ -63,6 +63,26 @@ private final BigdataGraph graph; /** + * URI used for typing elements. + */ + protected final URI TYPE; + + /** + * URI used to represent a Vertex. + */ + protected final URI VERTEX; + + /** + * URI used to represent a Edge. + */ + protected final URI EDGE; + + /** + * URI used for labeling edges. + */ + protected final URI LABEL; + + /** * The list of criteria. Bigdata's query optimizer will re-order the * criteria based on selectivity and execute for maximum performance and * minimum IO. @@ -76,6 +96,10 @@ public BigdataGraphQuery(final BigdataGraph graph) { this.graph = graph; + this.TYPE = graph.getValueFactory().getTypeURI(); + this.VERTEX = graph.getValueFactory().getVertexURI(); + this.EDGE = graph.getValueFactory().getEdgeURI(); + this.LABEL = graph.getValueFactory().getLabelURI(); } /** @@ -204,7 +228,7 @@ */ @Override public Iterable<Edge> edges() { - final String queryStr = toQueryStr(BigdataGraph.EDGE); + final String queryStr = toQueryStr(EDGE); return graph.getEdges(queryStr); } @@ -215,7 +239,7 @@ */ @Override public Iterable<Vertex> vertices() { - final String queryStr = toQueryStr(BigdataGraph.VERTEX); + final String queryStr = toQueryStr(VERTEX); return graph.getVertices(queryStr, true); } @@ -226,8 +250,8 @@ final StringBuilder sb = new StringBuilder(); - if (type == BigdataGraph.VERTEX) { - sb.append("construct { ?x rdf:type <"+type+"> . }\n"); + if (type == VERTEX) { + sb.append("construct { ?x <"+TYPE+"> <"+type+"> . }\n"); sb.append("{\n select distinct ?x where {\n"); } else { sb.append("construct { ?from ?x ?to . }\n"); @@ -235,7 +259,7 @@ sb.append(" ?from ?x ?to .\n"); } - final BlueprintsRDFFactory factory = graph.factory; + final BlueprintsValueFactory factory = graph.factory; boolean hasHas = false; @@ -304,7 +328,7 @@ // need a statement pattern for the filter not exists if (!hasHas) { - sb.append(" ?x rdf:type <").append(type).append("> .\n"); + sb.append(" ?x <"+TYPE+"> <").append(type).append("> .\n"); } @@ -334,7 +358,7 @@ private String toFilterStr(final BigdataPredicate pred, final String var, final Object val) { - final BlueprintsRDFFactory factory = graph.factory; + final BlueprintsValueFactory factory = graph.factory; final StringBuilder sb = new StringBuilder(); Added: branches/BIGDATA_RELEASE_1_3_0/bigdata-blueprints/src/java/com/bigdata/blueprints/BigdataGraphlet.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-blueprints/src/java/com/bigdata/blueprints/BigdataGraphlet.java (rev 0) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-blueprints/src/java/com/bigdata/blueprints/BigdataGraphlet.java 2014-07-18 15:30:35 UTC (rev 8574) @@ -0,0 +1,55 @@ +/** +Copyright (C) SYSTAP, LLC 2006-2014. All rights reserved. + +Contact: + SYSTAP, LLC + 4501 Tower Road + Greensboro, NC 27410 + lic...@bi... + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; version 2 of the License. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ +package com.bigdata.blueprints; + +import java.util.Collection; +import java.util.LinkedList; + +import com.tinkerpop.blueprints.Edge; +import com.tinkerpop.blueprints.Vertex; + +public class BigdataGraphlet { + + private final Collection<? extends Vertex> vertices; + private final Collection<? extends Edge> edges; + + public BigdataGraphlet() { + this.vertices = new LinkedList<Vertex>(); + this.edges = new LinkedList<Edge>(); + } + + public BigdataGraphlet(final Collection<? extends Vertex> vertices, + final Collection<? extends Edge> edges) { + this.vertices = vertices; + this.edges = edges; + } + + public Collection<? extends Vertex> getVertices() { + return vertices; + } + + public Collection<? extends Edge> getEdges() { + return edges; + } + +} Property changes on: branches/BIGDATA_RELEASE_1_3_0/bigdata-blueprints/src/java/com/bigdata/blueprints/BigdataGraphlet.java ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata-blueprints/src/java/com/bigdata/blueprints/BigdataPredicate.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-blueprints/src/java/com/bigdata/blueprints/BigdataPredicate.java 2014-07-17 22:45:00 UTC (rev 8573) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-blueprints/src/java/com/bigdata/blueprints/BigdataPredicate.java 2014-07-18 15:30:35 UTC (rev 8574) @@ -1,3 +1,25 @@ +/** +Copyright (C) SYSTAP, LLC 2006-Infinity. All rights reserved. + +Contact: + SYSTAP, LLC + 4501 Tower Road + Greensboro, NC 27410 + lic...@bi... + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; version 2 of the License. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ package com.bigdata.blueprints; import com.tinkerpop.blueprints.Compare; Added: branches/BIGDATA_RELEASE_1_3_0/bigdata-blueprints/src/java/com/bigdata/blueprints/BigdataQueryProjection.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-blueprints/src/java/com/bigdata/blueprints/BigdataQueryProjection.java (rev 0) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-blueprints/src/java/com/bigdata/blueprints/BigdataQueryProjection.java 2014-07-18 15:30:35 UTC (rev 8574) @@ -0,0 +1,508 @@ +/** +Copyright (C) SYSTAP, LLC 2006-Infinity. All rights reserved. + +Contact: + SYSTAP, LLC + 4501 Tower Road + Greensboro, NC 27410 + lic...@bi... + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; version 2 of the License. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ +package com.bigdata.blueprints; + +import java.util.Iterator; +import java.util.LinkedHashMap; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.apache.log4j.Logger; +import org.openrdf.model.Literal; +import org.openrdf.model.Statement; +import org.openrdf.model.URI; +import org.openrdf.model.Value; +import org.openrdf.query.BindingSet; +import org.openrdf.query.GraphQueryResult; +import org.openrdf.query.TupleQueryResult; + +import com.bigdata.blueprints.BigdataSelection.Bindings; +import com.tinkerpop.blueprints.Direction; +import com.tinkerpop.blueprints.Edge; +import com.tinkerpop.blueprints.Element; +import com.tinkerpop.blueprints.Vertex; +import com.tinkerpop.blueprints.VertexQuery; + +public class BigdataQueryProjection { + + private static final transient Logger log = Logger.getLogger(BigdataQueryProjection.class); + + private final BlueprintsValueFactory factory; + + public BigdataQueryProjection(final BlueprintsValueFactory factory) { + + this.factory = factory; + + } + + public BigdataSelection convert(final TupleQueryResult result) + throws Exception { + + final BigdataSelection selection = new BigdataSelection(); + + while (result.hasNext()) { + + final BindingSet bs = result.next(); + + final Bindings bindings = selection.newBindings(); + + for (String key : bs.getBindingNames()) { + + final Value val= bs.getBinding(key).getValue(); + + final Object o; + if (val instanceof Literal) { + o = factory.fromLiteral((Literal) val); + } else if (val instanceof URI) { + o = factory.fromURI((URI) val); + } else { + throw new RuntimeException("bnodes not legal: " + val); + } + + bindings.put(key, o); + + } + + } + + return selection; + + } + + public BigdataGraphlet convert(final GraphQueryResult stmts) throws Exception { + + final PartialGraph elements = new PartialGraph(); + + while (stmts.hasNext()) { + + final Statement stmt = stmts.next(); + + if (log.isInfoEnabled()) { + log.info(stmt); + } + + final Value o = stmt.getObject(); + + if (o instanceof URI) { + + handleEdge(elements, stmt); + + } else if (o instanceof Literal) { + + handleProperty(elements, stmt); + + } else { + + // how did we get a bnode? +// log.warn("ignoring: " + stmt); + + } + + } + + /* + * Attach properties to edges. + */ + final Iterator<Map.Entry<URI, PartialElement>> it = elements.properties.entrySet().iterator(); + + while (it.hasNext()) { + + final Map.Entry<URI, PartialElement> e = it.next(); + + final URI uri = e.getKey(); + + final PartialElement element = e.getValue(); + + boolean isEdge = false; + + for (Statement stmt : elements.edges.keySet()) { + + if (stmt.getPredicate().equals(uri)) { + + isEdge = true; + + final PartialEdge edge = elements.edges.get(stmt); + + edge.copyProperties(element); + + } + + } + + if (isEdge) { + it.remove(); + } + + } + + /* + * Attach properties to vertices. + */ + for (URI uri : elements.properties.keySet()) { + + final PartialElement element = elements.properties.get(uri); + + if (log.isInfoEnabled()) { + log.info(uri + ": " + element); + } + + final PartialVertex v = elements.putIfAbsent(uri); + + v.copyProperties(element); + + } + + /* + * Fill in any missing edge label. + */ + for (PartialEdge edge : elements.edges.values()) { + + if (edge.getLabel() == null) { + + edge.setLabel(edge.getId().toString()); + + } + + } + +// /* +// * Prune any incomplete edges. +// */ +// final Iterator<Element> it = elements.values().iterator(); +// +// while (it.hasNext()) { +// +// final Element e = it.next(); +// +// if (e instanceof PartialEdge) { +// +// if (!((PartialEdge) e).isComplete()) { +// +// it.remove(); +// +// } +// +// } +// +// } + + return new BigdataGraphlet( + elements.vertices.values(), elements.edges.values()); + + } + + private void handleEdge(final PartialGraph elements, final Statement stmt) { + + if (log.isTraceEnabled()) { + log.trace(stmt); + } + + final PartialVertex from = elements.putIfAbsent((URI) stmt.getSubject()); + + final PartialEdge edge = elements.putIfAbsent(stmt); + + final PartialVertex to = elements.putIfAbsent((URI) stmt.getObject()); + + edge.setFrom(from); + + edge.setTo(to); + +// // use the default label +// edge.setLabel(factory.fromEdgeURI(stmt.getPredicate())); + + } + + private void handleProperty(final PartialGraph elements, final Statement stmt) { + +// if (log.isInfoEnabled()) { +// log.info(stmt); +// } + + final URI uri = (URI) stmt.getSubject(); + + final PartialElement element = elements.putElementIfAbsent(uri); + + final String prop = factory.fromURI(stmt.getPredicate()); + + final Object val = factory.fromLiteral((Literal) stmt.getObject()); + +// if (prop.equals("label") && element instanceof PartialEdge) { +// +// ((PartialEdge) element).setLabel(val.toString()); +// +// } else { + + element.setProperty(prop, val); + +// } + + } + +// private PartialElement putIfAbsent(final URI uri) { +// +// if (factory.isEdge(uri)) { +// +// return putEdgeIfAbsent(uri); +// +// } else if (factory.isVertex(uri)) { +// +// return putVertexIfAbsent(uri); +// +// } else { +// +// throw new RuntimeException("bad element: " + uri); +// +// } +// +// } +// + private class PartialGraph { + + private final Map<URI, PartialElement> properties = new LinkedHashMap<URI, PartialElement>(); + + private final Map<Statement, PartialEdge> edges = new LinkedHashMap<Statement, PartialEdge>(); + + private final Map<URI, PartialVertex> vertices = new LinkedHashMap<URI, PartialVertex>(); + + private PartialElement putElementIfAbsent(final URI uri) { + + final String id = uri.toString(); + + if (properties.containsKey(uri)) { + + return (PartialElement) properties.get(uri); + + } else { + + final PartialElement e = new PartialElement(id); + + properties.put(uri, e); + + return e; + + } + + } + + private PartialVertex putIfAbsen... [truncated message content] |
From: <tob...@us...> - 2014-07-17 22:45:03
|
Revision: 8573 http://sourceforge.net/p/bigdata/code/8573 Author: tobycraig Date: 2014-07-17 22:45:00 +0000 (Thu, 17 Jul 2014) Log Message: ----------- Fixed query history not recognising previously executed queries Modified Paths: -------------- branches/BIGDATA_RELEASE_1_3_0/bigdata-war/src/html/js/workbench.js Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata-war/src/html/js/workbench.js =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-war/src/html/js/workbench.js 2014-07-17 20:58:48 UTC (rev 8572) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-war/src/html/js/workbench.js 2014-07-17 22:45:00 UTC (rev 8573) @@ -749,7 +749,7 @@ // see if this query is already in the history $('#query-history tbody tr').each(function(i, row) { - if($(row).find('.query')[0].innerText == query && $(row).find('.query-namespace').text() == NAMESPACE) { + if($(row).find('.query')[0].innerText == query) { // clear the old results and set the time to now $(row).find('.query-time').text(new Date().toISOString()); $(row).find('.query-results').text('...'); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tho...@us...> - 2014-07-17 20:59:01
|
Revision: 8572 http://sourceforge.net/p/bigdata/code/8572 Author: thompsonbry Date: 2014-07-17 20:58:48 +0000 (Thu, 17 Jul 2014) Log Message: ----------- Checkpoint on GIST refactor (#585) in support of group commit for the REST API (#566). This commit relayers the interfaces a bit and introduces interfaces for IGISTManager and IGISTLocalManager. This is being done in an attempt to create a distinction between the different APIs for mananging durable indices. There are several families of such interfaces for the indices and the management of those indices. For the indices: 1. IIndex: This supports both local and scale-out B+Tree indices. 2. ICheckpointProtocol: This is the local GIST abstraction for durable objects. BTree, HTree, and Stream all implement this interface. 3. ILocalBTree: This is the local abstraction for a B+Tree object, but one that may be comprised of an ordered view. This supports both scale-out and transaction isolation. For the management of those indices: IGISTManager and IGISTLocalManager: GIST support. IIndexManager: both local BTree and scale-out support. IBTreeManager: adds local GIST index access methods. Modified Paths: -------------- branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/bop/fed/DelegateIndexManager.java branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/btree/Checkpoint.java branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/btree/ILocalBTreeView.java branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/btree/ReadCommittedView.java branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/btree/isolation/IsolatedFusedView.java branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/btree/proc/IIndexProcedure.java branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/btree/view/FusedView.java branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/journal/AbstractJournal.java branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/journal/AbstractTask.java branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/journal/DumpJournal.java branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/journal/IBTreeManager.java branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/journal/IIndexManager.java branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/journal/IIndexStore.java branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/journal/IJournal.java branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/journal/IResourceManager.java branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/journal/ITask.java branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/journal/IndexProcedureTask.java branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/journal/TemporaryStore.java branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/service/MetadataService.java Added Paths: ----------- branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/journal/IGISTLocalManager.java branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/journal/IGISTManager.java Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/bop/fed/DelegateIndexManager.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/bop/fed/DelegateIndexManager.java 2014-07-17 19:26:38 UTC (rev 8571) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/bop/fed/DelegateIndexManager.java 2014-07-17 20:58:48 UTC (rev 8572) @@ -1,3 +1,27 @@ +/* + +Copyright (C) SYSTAP, LLC 2006-2008. All rights reserved. + +Contact: + SYSTAP, LLC + 4501 Tower Road + Greensboro, NC 27410 + lic...@bi... + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; version 2 of the License. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +*/ package com.bigdata.bop.fed; import java.util.Iterator; @@ -35,8 +59,6 @@ * how to create the index partition view. * * @author <a href="mailto:tho...@us...">Bryan Thompson</a> - * @version $Id: JoinTaskFactoryTask.java 3448 2010-08-18 20:55:58Z thompsonbry - * $ * * @todo While this class solves our problem I do not know whether or not this * class should this class have more visibility? The downside is that it @@ -64,7 +86,10 @@ /** * Delegates to the {@link IndexManager}. + * <p> + * {@inheritDoc} */ + @Override public IIndex getIndex(final String name, final long timestamp) { return dataService.getResourceManager().getIndex(name, timestamp); @@ -73,7 +98,10 @@ /** * Not allowed. + * <p> + * {@inheritDoc} */ + @Override public void dropIndex(final String name) { throw new UnsupportedOperationException(); @@ -83,79 +111,93 @@ /** * Not allowed. */ + @Override public void registerIndex(IndexMetadata indexMetadata) { throw new UnsupportedOperationException(); } + @Override public void destroy() { throw new UnsupportedOperationException(); } + @Override public ExecutorService getExecutorService() { return dataService.getFederation().getExecutorService(); } + @Override public BigdataFileSystem getGlobalFileSystem() { return dataService.getFederation().getGlobalFileSystem(); } + @Override public SparseRowStore getGlobalRowStore() { return dataService.getFederation().getGlobalRowStore(); } + @Override public SparseRowStore getGlobalRowStore(final long timestamp) { return dataService.getFederation().getGlobalRowStore(timestamp); } + @Override public long getLastCommitTime() { return dataService.getFederation().getLastCommitTime(); } + @Override public IResourceLocator getResourceLocator() { return dataService.getFederation().getResourceLocator(); } - + + @Override public IResourceLockService getResourceLockService() { return dataService.getFederation().getResourceLockService(); } + @Override public TemporaryStore getTempStore() { return dataService.getFederation().getTempStore(); } + @Override public ScheduledFuture<?> addScheduledTask(Runnable task, long initialDelay, long delay, TimeUnit unit) { return dataService.getFederation().addScheduledTask(task, initialDelay, delay, unit); } + @Override public boolean getCollectPlatformStatistics() { return dataService.getFederation().getCollectPlatformStatistics(); } + @Override public boolean getCollectQueueStatistics() { return dataService.getFederation().getCollectQueueStatistics(); } + @Override public int getHttpdPort() { return dataService.getFederation().getHttpdPort(); } @@ -171,6 +213,7 @@ return dataService.getFederation().getCounters(); } + @Override public String toString() { return super.toString() + "{dataServiceUUID=" Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/btree/Checkpoint.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/btree/Checkpoint.java 2014-07-17 19:26:38 UTC (rev 8571) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/btree/Checkpoint.java 2014-07-17 20:58:48 UTC (rev 8572) @@ -49,7 +49,6 @@ * you can start using the index. * * @author <a href="mailto:tho...@us...">Bryan Thompson</a> - * @version $Id$ */ public class Checkpoint implements ICheckpoint, Externalizable { @@ -782,13 +781,14 @@ } /** - * Create a persistence capable data structure. + * Generic method to create a persistence capable data structure (GIST + * compatible, core implementation). * * @param store * The backing store. * @param metadata * The metadata that describes the data structure to be created. - * + * * @return The persistence capable data structure. */ public static ICheckpointProtocol create(final IRawStore store, Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/btree/ILocalBTreeView.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/btree/ILocalBTreeView.java 2014-07-17 19:26:38 UTC (rev 8571) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/btree/ILocalBTreeView.java 2014-07-17 20:58:48 UTC (rev 8572) @@ -36,7 +36,6 @@ * {@link AbstractBTree}s. * * @author <a href="mailto:tho...@us...">Bryan Thompson</a> - * @version $Id$ */ public interface ILocalBTreeView extends IIndex { Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/btree/ReadCommittedView.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/btree/ReadCommittedView.java 2014-07-17 19:26:38 UTC (rev 8571) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/btree/ReadCommittedView.java 2014-07-17 20:58:48 UTC (rev 8572) @@ -76,7 +76,6 @@ * its public API. * * @author <a href="mailto:tho...@us...">Bryan Thompson</a> - * @version $Id$ */ public class ReadCommittedView implements ILocalBTreeView { Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/btree/isolation/IsolatedFusedView.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/btree/isolation/IsolatedFusedView.java 2014-07-17 19:26:38 UTC (rev 8571) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/btree/isolation/IsolatedFusedView.java 2014-07-17 20:58:48 UTC (rev 8572) @@ -101,7 +101,6 @@ * {@link ITx#UNISOLATED} {@link AbstractTask} which handles this process. </p> * * @author <a href="mailto:tho...@us...">Bryan Thompson</a> - * @version $Id$ */ public class IsolatedFusedView extends FusedView { Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/btree/proc/IIndexProcedure.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/btree/proc/IIndexProcedure.java 2014-07-17 19:26:38 UTC (rev 8571) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/btree/proc/IIndexProcedure.java 2014-07-17 20:58:48 UTC (rev 8572) @@ -99,7 +99,7 @@ * @todo add generic type for {@link #apply(IIndex)} 's return value (much like * {@link Callable}). */ -public interface IIndexProcedure extends IReadOnly, Serializable { +public interface IIndexProcedure<T> extends IReadOnly, Serializable { // /** // * Return <code>true</code> iff the procedure asserts that it will not @@ -127,6 +127,6 @@ * this MUST be {@link Serializable} since it may have to pass * across a network interface. */ - public Object apply(IIndex ndx); + public T apply(IIndex ndx); } Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/btree/view/FusedView.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/btree/view/FusedView.java 2014-07-17 19:26:38 UTC (rev 8571) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/btree/view/FusedView.java 2014-07-17 20:58:48 UTC (rev 8572) @@ -91,7 +91,6 @@ * could be transparent at that point. * * @author <a href="mailto:tho...@us...">Bryan Thompson</a> - * @version $Id$ */ public class FusedView implements IIndex, ILocalBTreeView {//, IValueAge { Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/journal/AbstractJournal.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/journal/AbstractJournal.java 2014-07-17 19:26:38 UTC (rev 8571) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/journal/AbstractJournal.java 2014-07-17 20:58:48 UTC (rev 8572) @@ -245,7 +245,6 @@ * </p> * * @author <a href="mailto:tho...@us...">Bryan Thompson</a> - * @version $Id$ * * @todo There are lots of annoying ways in which asynchronously closing the * journal, e.g., using {@link #close()} or {@link #shutdown()} can cause @@ -5069,7 +5068,7 @@ * cache for access to historical index views on the Journal by name * and commitTime. </a> * - * TODO Reconcile API tension with {@link IIndex} and + * FIXME GIST Reconcile API tension with {@link IIndex} and * {@link ICheckpointProtocol}, however this method is overridden by * {@link Journal} and is also implemented by * {@link IBigdataFederation}. The central remaining tensions are @@ -5654,8 +5653,10 @@ } /** + * {@inheritDoc} + * <p> * Drops the named index. The index will no longer participate in atomic - * commits and will not be visible to new transactions. Storage will be + * commits and will not be visible to new transactions. Storage will be * reclaimed IFF the backing store support that functionality. */ @Override Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/journal/AbstractTask.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/journal/AbstractTask.java 2014-07-17 19:26:38 UTC (rev 8571) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/journal/AbstractTask.java 2014-07-17 20:58:48 UTC (rev 8572) @@ -202,6 +202,7 @@ } + /** Guarded by <code>synchronized(AbstractTask)</code>. */ private IJournal journal; /** @@ -454,8 +455,8 @@ */ private class DirtyListener implements IDirtyListener { - final String name; - final ICheckpointProtocol btree; + private final String name; + private final ICheckpointProtocol ndx; @Override public String toString() { @@ -473,7 +474,7 @@ this.name = name; - this.btree = ndx; + this.ndx = ndx; } @@ -486,7 +487,7 @@ @Override public void dirtyEvent(final ICheckpointProtocol btree) { - assert btree == this.btree; + assert btree == this.ndx; if (commitList.put(name, this) != null) { @@ -940,7 +941,7 @@ * * @see IIndexManager#dropIndex(String) */ - synchronized public void dropIndex(String name) { + synchronized public void dropIndex(final String name) { if (name == null) throw new IllegalArgumentException(); @@ -986,7 +987,7 @@ } - /** + /** * {@link Callable} checkpoints an index. * * @author <a href="mailto:tho...@us...">Bryan @@ -1013,7 +1014,7 @@ try { - l.btree.writeCheckpoint(); + l.ndx.writeCheckpoint(); } catch (Throwable t) { @@ -1192,7 +1193,7 @@ + entry.name); name2Addr.registerIndex(entry.name, (BTree)commitList - .get(entry.name).btree); + .get(entry.name).ndx); } else { @@ -1223,7 +1224,7 @@ + entry.name); name2Addr - .putOnCommitList(l.name, l.btree, false/*needsCheckpoint*/); + .putOnCommitList(l.name, l.ndx, false/*needsCheckpoint*/); } @@ -2549,6 +2550,12 @@ } + /** + * FIXME GIST This needs to use logic to handle the different types of + * index objects that we can create. That logic is currently centralized + * in {@link AbstractJournal#register(String, IndexMetadata)}. The same + * pattern needs to be put to use here. + */ @Override public IIndex registerIndex(final String name, final IndexMetadata indexMetadata) { @@ -2754,12 +2761,12 @@ * {@link AbstractTask} will be imposed on access to the * {@link ILocatableResource}s. * - * FIXME Reconsider the inner journal classes on AbstractTask. This is a - * heavy weight mechanism for enforcing isolation for temporary stores. - * It would be better to have isolation in the locator mechanism itself. - * This will especially effect scale-out query using temporary stores - * and will break semantics when the task is isolated by a transaction - * rather than unisolated. + * FIXME GIST Reconsider the inner journal classes on AbstractTask. This + * is a heavy weight mechanism for enforcing isolation for temporary + * stores. It would be better to have isolation in the locator mechanism + * itself. This will especially effect scale-out query using temporary + * stores and will break semantics when the task is isolated by a + * transaction rather than unisolated. */ @Override public TemporaryStore getTempStore() { @@ -2767,7 +2774,7 @@ return tempStoreFactory.getTempStore(); } - private TemporaryStoreFactory tempStoreFactory = new TemporaryStoreFactory(); + final private TemporaryStoreFactory tempStoreFactory = new TemporaryStoreFactory(); @Override public IResourceLocator<?> getResourceLocator() { Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/journal/DumpJournal.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/journal/DumpJournal.java 2014-07-17 19:26:38 UTC (rev 8571) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/journal/DumpJournal.java 2014-07-17 20:58:48 UTC (rev 8572) @@ -673,9 +673,6 @@ /** * Dump metadata about each named index as of the specified commit record. - * - * @param journal - * @param commitRecord */ private void dumpNamedIndicesMetadata(final PrintWriter out, final List<String> namespaces, final ICommitRecord commitRecord, Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/journal/IBTreeManager.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/journal/IBTreeManager.java 2014-07-17 19:26:38 UTC (rev 8571) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/journal/IBTreeManager.java 2014-07-17 20:58:48 UTC (rev 8572) @@ -29,14 +29,11 @@ package com.bigdata.journal; import com.bigdata.btree.BTree; -import com.bigdata.btree.Checkpoint; import com.bigdata.btree.ICheckpointProtocol; import com.bigdata.btree.IIndex; -import com.bigdata.btree.ILocalBTreeView; import com.bigdata.btree.IndexMetadata; import com.bigdata.btree.view.FusedView; import com.bigdata.htree.HTree; -import com.bigdata.rawstore.IRawStore; import com.bigdata.service.IDataService; import com.bigdata.service.IMetadataService; import com.bigdata.service.ndx.IClientIndex; @@ -45,20 +42,19 @@ * Interface for management of local index resources such as {@link BTree}, * {@link HTree}, etc. * - * @todo change registerIndex() methods to return void and have people use - * {@link #getIndex(String)} to obtain the view after they have registered - * the index. This will make it somewhat easier to handle things like the - * registration of an index partition reading from multiple resources or - * the registration of indices that are not {@link BTree}s (HTree, Stream, - * etc). + * TODO GIST This interface was historically only for the local {@link BTree}. + * The GIST support has been pushed down into the {@link IGISTLocalManager}. The + * {@link BTree} and {@link IIndex} specific methods on this interface are a + * mixture of convenience and support for scale-out and should eventually be + * phased out of this interface. The interface itself could be renamed to + * something along the lines of "IIndexLocalManager". * * @author <a href="mailto:tho...@us...">Bryan Thompson</a> - * @version $Id$ * * @see <a href="https://sourceforge.net/apps/trac/bigdata/ticket/585" > GIST * </a> */ -public interface IBTreeManager extends IIndexManager { +public interface IBTreeManager extends IIndexManager, IGISTLocalManager { /** * Register a named index. @@ -73,10 +69,12 @@ * * @exception IndexExistsException * if there is an index already registered under that name. - * Use {@link IIndexStore#getIndex(String)} to test whether - * there is an index registered under a given name. + * + * @see IIndexManager#registerIndex(IndexMetadata) + * @see IIndexManager#getIndex(String, long) + * @see IGISTLocalManager#getIndexLocal(String, long) */ - public IIndex registerIndex(String name, BTree btree); + IIndex registerIndex(String name, BTree btree); // non-GIST /** * Register a named index. @@ -106,49 +104,29 @@ * * @return The object that would be returned by {@link #getIndex(String)}. * - * @see #registerIndex(String, IndexMetadata) + * @throws IndexExistsException + * if there is an index already registered under that name. * - * @exception IndexExistsException - * if there is an index already registered under that name. - * Use {@link IIndexStore#getIndex(String)} to test whether - * there is an index registered under a given name. + * @see IIndexManager#getIndex(String, long) + * @see IGISTLocalManager#getIndexLocal(String, long) * - * TODO Due to the method signature, this method CAN NOT be - * used to create and register persistence capable data - * structures other than an {@link IIndex} (aka B+Tree). It - * is difficult to reconcile this method with other method - * signatures since this method is designed for scale-out and - * relies on {@link IIndex}. However, only the B+Tree is an - * {@link IIndex}. Therefore, this method signature can not - * be readily reconciled with the {@link HTree}. The only - * interface which the {@link BTree} and {@link HTree} share - * is the {@link ICheckpointProtocol} interface, but that is - * a purely local (not remote) interface and is therefore not - * suitable to scale-out. Also, it is only in scale-out where - * the returned object can be a different type than the - * simple {@link BTree} class, e.g., a {@link FusedView} or - * even an {@link IClientIndex}. + * FIXME GIST Due to the method signature, this method CAN NOT be used + * to create and register persistence capable data structures other + * than an {@link IIndex} (aka B+Tree). It is difficult to reconcile + * this method with other method signatures since this method is + * designed for scale-out and relies on {@link IIndex}. However, only + * the B+Tree is an {@link IIndex}. Therefore, this method signature + * can not be readily reconciled with the {@link HTree}. The only + * interface which the {@link BTree} and {@link HTree} share is the + * {@link ICheckpointProtocol} interface, but that is a purely local + * (not remote) interface and is therefore not suitable to scale-out. + * Also, it is only in scale-out where the returned object can be a + * different type than the simple {@link BTree} class, e.g., a + * {@link FusedView} or even an {@link IClientIndex}. */ - public IIndex registerIndex(String name, IndexMetadata indexMetadata); + IIndex registerIndex(String name, IndexMetadata indexMetadata); // non-GIST /** - * Variant method creates and registered a named persistence capable data - * structure but does not assume that the data structure will be a - * {@link BTree}. - * - * @param store - * The backing store. - * @param metadata - * The metadata that describes the data structure to be created. - * - * @return The persistence capable data structure. - * - * @see Checkpoint#create(IRawStore, IndexMetadata) - */ - public ICheckpointProtocol register(final String name, - final IndexMetadata metadata); - - /** * Return the unisolated view of the named index (the mutable view of the * live index object). * @@ -161,56 +139,6 @@ * @exception IllegalArgumentException * if <i>name</i> is <code>null</code> */ - public IIndex getIndex(String name); + IIndex getIndex(String name); // non-GIST - /** - * Return the mutable view of the named persistence capable data structure - * (aka the "live" or {@link ITx#UNISOLATED} view). - * <p> - * Note: {@link #getIndex(String)} delegates to this method and then casts - * the result to an {@link IIndex}. This is the core implementation to - * access an existing named index. - * - * @return The mutable view of the persistence capable data structure. - * - * @see #getIndex(String) - * - * @see <a href="https://sourceforge.net/apps/trac/bigdata/ticket/585" > - * GIST </a> - */ - public ICheckpointProtocol getUnisolatedIndex(final String name); - - /** - * Core implementation for access to historical index views. - * <p> - * Note: Transactions should pass in the timestamp against which they are - * reading rather than the transaction identifier (aka startTime). By - * providing the timestamp of the commit point, the transaction will hit the - * {@link #indexCache}. If the transaction passes the startTime instead, - * then all startTimes will be different and the cache will be defeated. - * - * @throws UnsupportedOperationException - * If you pass in {@link ITx#UNISOLATED}, - * {@link ITx#READ_COMMITTED}, or a timestamp that corresponds - * to a read-write transaction since those are not "commit - * times". - * - * @see IIndexStore#getIndex(String, long) - * - * @see <a href="http://sourceforge.net/apps/trac/bigdata/ticket/546" > Add - * cache for access to historical index views on the Journal by name - * and commitTime. </a> - * - * @see <a href="https://sourceforge.net/apps/trac/bigdata/ticket/585" > - * GIST </a> - * - * FIXME GIST : Reconcile with - * {@link IResourceManager#getIndex(String, long)}. They are returning - * types that do not overlap ({@link ICheckpointProtocol} and - * {@link ILocalBTreeView}). This is blocking the support of GIST in - * {@link AbstractTask}. - */ - public ICheckpointProtocol getIndexLocal(final String name, - final long commitTime); - } Added: branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/journal/IGISTLocalManager.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/journal/IGISTLocalManager.java (rev 0) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/journal/IGISTLocalManager.java 2014-07-17 20:58:48 UTC (rev 8572) @@ -0,0 +1,112 @@ +/** + +Copyright (C) SYSTAP, LLC 2006-2007. All rights reserved. + +Contact: + SYSTAP, LLC + 4501 Tower Road + Greensboro, NC 27410 + lic...@bi... + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; version 2 of the License. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ +/* + * Created on July 17, 2014 + */ +package com.bigdata.journal; + +import com.bigdata.btree.Checkpoint; +import com.bigdata.btree.ICheckpointProtocol; +import com.bigdata.btree.IIndex; +import com.bigdata.btree.ILocalBTreeView; +import com.bigdata.btree.IndexMetadata; +import com.bigdata.rawstore.IRawStore; + +/** + * Interface for managing local (non-distributed) generalized search trees + * (GiST). + * + * @author <a href="mailto:tho...@us...">Bryan Thompson</a> + * + * @see <a href="https://sourceforge.net/apps/trac/bigdata/ticket/585" > GIST + * </a> + */ +public interface IGISTLocalManager extends IGISTManager { + + /** + * Method creates and registers a named persistence capable data structure. + * + * @param name + * The name of the index. + * @param metadata + * The metadata that describes the data structure to be created. + * + * @return The persistence capable data structure. + * + * @see IGISTManager#registerIndex(IndexMetadata) + * @see Checkpoint#create(IRawStore, IndexMetadata) + */ + ICheckpointProtocol register(String name, IndexMetadata metadata); // GIST + + /** + * Return the mutable view of the named persistence capable data structure + * (aka the "live" or {@link ITx#UNISOLATED} view). + * <p> + * Note: {@link IIndexManager#getIndex(String)} delegates to this method and + * then casts the result to an {@link IIndex}. This is the core + * implementation to access an existing named index. + * + * @return The mutable view of the persistence capable data structure. + * + * @see IIndexManager#getIndex(String) + * + * @see <a href="https://sourceforge.net/apps/trac/bigdata/ticket/585" > + * GIST </a> + */ + ICheckpointProtocol getUnisolatedIndex(String name); // GIST + + /** + * Core implementation for access to historical index views. + * <p> + * Note: Transactions should pass in the timestamp against which they are + * reading rather than the transaction identifier (aka startTime). By + * providing the timestamp of the commit point, the transaction will hit the + * index cache on the journal. If the transaction passes the startTime + * instead, then all startTimes will be different and the cache will be + * defeated. + * + * @throws UnsupportedOperationException + * If you pass in {@link ITx#UNISOLATED}, + * {@link ITx#READ_COMMITTED}, or a timestamp that corresponds + * to a read-write transaction since those are not "commit + * times". + * + * @see IIndexStore#getIndex(String, long) + * + * @see <a href="http://sourceforge.net/apps/trac/bigdata/ticket/546" > Add + * cache for access to historical index views on the Journal by name + * and commitTime. </a> + * + * @see <a href="https://sourceforge.net/apps/trac/bigdata/ticket/585" > + * GIST </a> + * + * FIXME GIST : Reconcile with + * {@link IResourceManager#getIndex(String, long)}. They are returning + * types that do not overlap ({@link ICheckpointProtocol} and + * {@link ILocalBTreeView}). This is blocking the support of GIST in + * {@link AbstractTask}. + */ + ICheckpointProtocol getIndexLocal(String name, long commitTime); // GIST + +} Added: branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/journal/IGISTManager.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/journal/IGISTManager.java (rev 0) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/journal/IGISTManager.java 2014-07-17 20:58:48 UTC (rev 8572) @@ -0,0 +1,103 @@ +/** + +Copyright (C) SYSTAP, LLC 2006-2007. All rights reserved. + +Contact: + SYSTAP, LLC + 4501 Tower Road + Greensboro, NC 27410 + lic...@bi... + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; version 2 of the License. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ +/* + * Created on July 17, 2014 + */ +package com.bigdata.journal; + +import java.util.Iterator; + +import com.bigdata.btree.IndexMetadata; + +/** + * Interface for managing local or distributed index structures in a manner that + * is not B+Tree specific. These methods are thus GIST compatible, but that does + * not guarantee distributed support for all GIST data structures. + * + * @author <a href="mailto:tho...@us...">Bryan Thompson</a> + * + * @see <a href="https://sourceforge.net/apps/trac/bigdata/ticket/585" > GIST + * </a> + */ +public interface IGISTManager { + + /** + * Register a named index. + * <p> + * Note: The <i>name</i> property MUST be set on the {@link IndexMetadata} + * and the index will be registered under that name. + * + * @param indexMetadata + * The metadata describing the index. + * + * @throws IllegalArgumentException + * if the argument is <code>null</code>. + * @throws IllegalArgumentException + * if the name argument was not specified when the + * {@link IndexMetadata} was created. + * + * @exception IndexExistsException + * if there is an index already registered under the name + * returned by {@link IndexMetadata#getName()}. + * + * @see IGISTLocalManager#getIndexLocal(String, long) + */ + void registerIndex(IndexMetadata indexMetadata);// GIST + + /** + * Drops the named index. + * <p> + * Note: Whether or not and when index resources are reclaimed is dependent + * on the store. For example, an immortal store will retain all historical + * states for all indices. Likewise, a store that uses index partitions may + * be able to delete index segments immediately. + * + * @param name + * The name of the index to be dropped. + * + * @exception NoSuchIndexException + * if <i>name</i> does not identify a registered index. + */ + void dropIndex(String name); // GIST + + /** + * Iterator visits the names of all indices spanned by the given prefix. + * + * @param prefix + * The prefix (optional). When given, this MUST include a + * <code>.</code> if you want to restrict the scan to only those + * indices in a given namespace. Otherwise you can find indices + * in <code>kb2</code> if you provide the prefix <code>kb</code> + * where both kb and kb2 are namespaces since the indices spanned + * by <code>kb</code> would include both <code>kb.xyz</code> and + * <code>kb2.xyx</code>. + * @param timestamp + * A timestamp which represents either a possible commit time on + * the store or a read-only transaction identifier. + * + * @return An iterator visiting those index names. + */ + Iterator<String> indexNameScan(String prefix, long timestamp); // GIST + +} Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/journal/IIndexManager.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/journal/IIndexManager.java 2014-07-17 19:26:38 UTC (rev 8571) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/journal/IIndexManager.java 2014-07-17 20:58:48 UTC (rev 8572) @@ -27,7 +27,7 @@ package com.bigdata.journal; -import com.bigdata.btree.IndexMetadata; +import com.bigdata.btree.IIndex; import com.bigdata.counters.ICounterSetAccess; /** @@ -35,45 +35,22 @@ * * @author <a href="mailto:tho...@us...">Bryan Thompson</a> */ -public interface IIndexManager extends IIndexStore, ICounterSetAccess { +public interface IIndexManager extends IIndexStore, IGISTManager, ICounterSetAccess { /** - * Register a named index. - * <p> - * Note: The <i>name</i> property MUST be set on the {@link IndexMetadata} - * and the index will be registered under that name. + * Return a view of the named index as of the specified timestamp. * - * @param indexMetadata - * The metadata describing the index. + * @param name + * The index name. + * @param timestamp + * A timestamp which represents either a possible commit time on + * the store or a read-only transaction identifier. * - * @throws IllegalArgumentException - * if the argument is <code>null</code>. - * @throws IllegalArgumentException - * if the name argument was not specified when the - * {@link IndexMetadata} was created. + * @return The index or <code>null</code> iff there is no index registered + * with that name for that timestamp. * - * @exception IndexExistsException - * if there is an index already registered under the name - * returned by {@link IndexMetadata#getName()}. Use - * {@link IIndexStore#getIndex(String)} to test whether there - * is an index registered under a given name. + * @see IBTreeManager#getIndexLocal(String, long) */ - public void registerIndex(IndexMetadata indexMetadata); + IIndex getIndex(String name, long timestamp); // non-GIST - /** - * Drops the named index. - * <p> - * Note: Whether or not and when index resources are reclaimed is dependent - * on the store. For example, an immortal store will retain all historical - * states for all indices. Likewise, a store that uses index partitions may - * be able to delete index segments immediately. - * - * @param name - * The name of the index to be dropped. - * - * @exception NoSuchIndexException - * if <i>name</i> does not identify a registered index. - */ - public void dropIndex(String name); - } Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/journal/IIndexStore.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/journal/IIndexStore.java 2014-07-17 19:26:38 UTC (rev 8571) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/journal/IIndexStore.java 2014-07-17 20:58:48 UTC (rev 8572) @@ -23,67 +23,36 @@ */ package com.bigdata.journal; -import java.util.Iterator; import java.util.concurrent.ExecutorService; import java.util.concurrent.ScheduledFuture; import java.util.concurrent.TimeUnit; import com.bigdata.bfs.BigdataFileSystem; import com.bigdata.btree.AbstractBTree; -import com.bigdata.btree.IIndex; import com.bigdata.rawstore.IRawStore; import com.bigdata.relation.locator.IResourceLocator; import com.bigdata.sparse.GlobalRowStoreSchema; import com.bigdata.sparse.SparseRowStore; /** - * Interface accessing named indices. + * Collection of methods that are shared by both local and distributed stores. + * <p> + * Note: Historically, this was class was named for the ability to manage index + * objects in both local and distributed contexts. However, the introduction of + * GIST support has necessitated a refactoring of the interfaces and the name of + * this interface no longer reflects its function. * * @author <a href="mailto:tho...@us...">Bryan Thompson</a> - * @version $Id$ */ public interface IIndexStore { /** - * Return a view of the named index as of the specified timestamp. - * - * @param name - * The index name. - * @param timestamp - * A timestamp which represents either a possible commit time on - * the store or a read-only transaction identifier. - * - * @return The index or <code>null</code> iff there is no index registered - * with that name for that timestamp. - */ - public IIndex getIndex(String name, long timestamp); - - /** - * Iterator visits the names of all indices spanned by the given prefix. - * - * @param prefix - * The prefix (optional). When given, this MUST include a - * <code>.</code> if you want to restrict the scan to only those - * indices in a given namespace. Otherwise you can find indices - * in <code>kb2</code> if you provide the prefix <code>kb</code> - * where both kb and kb2 are namespaces since the indices spanned - * by <code>kb</code> would include both <code>kb.xyz</code> and - * <code>kb2.xyx</code>. - * @param timestamp - * A timestamp which represents either a possible commit time on - * the store or a read-only transaction identifier. - * - * @return An iterator visiting those index names. - */ - public Iterator<String> indexNameScan(String prefix, long timestamp); - - /** * Return an unisolated view of the global {@link SparseRowStore} used to * store named property sets. * * @see GlobalRowStoreSchema */ - public SparseRowStore getGlobalRowStore(); + SparseRowStore getGlobalRowStore(); /** * Return a view of the global {@link SparseRowStore} used to store named @@ -102,7 +71,7 @@ * @return The global row store view -or- <code>null</code> if no view * exists as of that timestamp. */ - public SparseRowStore getGlobalRowStore(long timestamp); + SparseRowStore getGlobalRowStore(long timestamp); /** * Return the global file system used to store block-structured files and @@ -110,7 +79,7 @@ * * @see BigdataFileSystem */ - public BigdataFileSystem getGlobalFileSystem(); + BigdataFileSystem getGlobalFileSystem(); /** * A factory for {@link TemporaryStore}s. {@link TemporaryStore}s are @@ -135,13 +104,13 @@ * * @return A {@link TemporaryStore}. */ - public TemporaryStore getTempStore(); + TemporaryStore getTempStore(); /** * Return the default locator for resources that are logical index * containers (relations and relation containers). */ - public IResourceLocator getResourceLocator(); + IResourceLocator getResourceLocator(); /** * A {@link ExecutorService} that may be used to parallelize operations. @@ -149,7 +118,7 @@ * While the service does not impose concurrency controls, tasks run on this * service may submit operations to a {@link ConcurrencyManager}. */ - public ExecutorService getExecutorService(); + ExecutorService getExecutorService(); /** * Adds a task which will run until canceled, until it throws an exception, @@ -166,19 +135,19 @@ * * @return The {@link ScheduledFuture} for that task. */ - public ScheduledFuture<?> addScheduledTask(final Runnable task, + ScheduledFuture<?> addScheduledTask(final Runnable task, final long initialDelay, final long delay, final TimeUnit unit); /** * <code>true</code> iff performance counters will be collected for the * platform on which the client is running. */ - public boolean getCollectPlatformStatistics(); + boolean getCollectPlatformStatistics(); /** * <code>true</code> iff statistics will be collected for work queues. */ - public boolean getCollectQueueStatistics(); + boolean getCollectQueueStatistics(); /** * The port on which the optional httpd service will be run. The httpd @@ -186,13 +155,13 @@ * platform on which it is running, etc. If this is ZERO (0), then the * port will be chosen randomly. */ - public int getHttpdPort(); + int getHttpdPort(); /** * The service that may be used to acquire synchronous distributed locks * <strong>without deadlock detection</strong>. */ - public IResourceLockService getResourceLockService(); + IResourceLockService getResourceLockService(); /** * The database wide timestamp of the most recent commit on the store or 0L @@ -210,11 +179,11 @@ * * @see IRootBlockView#getLastCommitTime() */ - public long getLastCommitTime(); + long getLastCommitTime(); /** * Destroy the {@link IIndexStore}. */ - public void destroy(); + void destroy(); } Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/journal/IJournal.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/journal/IJournal.java 2014-07-17 19:26:38 UTC (rev 8571) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/journal/IJournal.java 2014-07-17 20:58:48 UTC (rev 8572) @@ -32,7 +32,6 @@ * named indices, and transactions. * * @author <a href="mailto:tho...@us...">Bryan Thompson</a> - * @version $Id$ */ public interface IJournal extends IMRMW, IAtomicStore, IBTreeManager { Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/journal/IResourceManager.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/journal/IResourceManager.java 2014-07-17 19:26:38 UTC (rev 8571) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/journal/IResourceManager.java 2014-07-17 20:58:48 UTC (rev 8572) @@ -64,7 +64,6 @@ * segment resources and the concurrency control from the journal itself. * * @author <a href="mailto:tho...@us...">Bryan Thompson</a> - * @version $Id$ */ public interface IResourceManager extends IServiceShutdown { @@ -135,7 +134,7 @@ * * @see FusedView */ - public AbstractBTree[] getIndexSources(String name, long timestamp); + AbstractBTree[] getIndexSources(String name, long timestamp); // non-GIST /** * Examine the partition metadata (if any) for the {@link BTree}. If the @@ -151,7 +150,7 @@ * * @return The source(s) for the view associated with that {@link BTree}. */ - public AbstractBTree[] getIndexSources(String name, long timestamp, BTree btree); + AbstractBTree[] getIndexSources(String name, long timestamp, BTree btree); // non-GIST /** * Return a view of the named index as of the specified timestamp. @@ -191,7 +190,7 @@ * @see <a href="https://sourceforge.net/apps/trac/bigdata/ticket/585" > * GIST </a> */ - public ILocalBTreeView getIndex(String name, long timestamp); + ILocalBTreeView getIndex(String name, long timestamp); // non-GIST /** * Return non-<code>null</code> iff <i>name</i> is the name of an @@ -306,17 +305,22 @@ // */ // public UUID[] getDataServiceUUIDs(); - /** - * Return the {@link BTreeCounters} for the named index. If none exist, then - * a new instance is atomically created and returned to the caller. This - * facilitates the reuse of the same {@link BTreeCounters} instance for all - * views of the named index. - * - * @param name - * The name of the index. - * - * @return The counters for that index and never <code>null</code>. - */ - public BTreeCounters getIndexCounters(final String name); + /** + * Return the {@link BTreeCounters} for the named index. If none exist, then + * a new instance is atomically created and returned to the caller. This + * facilitates the reuse of the same {@link BTreeCounters} instance for all + * views of the named index. + * + * @param name + * The name of the index. + * + * @return The counters for that index and never <code>null</code>. + * + * FIXME GIST The HTree class and other durable data structures + * should also have published performance counters. This is the + * simplest for the HTree since it has a lot in common with the + * BTree. + */ + BTreeCounters getIndexCounters(final String name); // non-GIST } Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/journal/ITask.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/journal/ITask.java 2014-07-17 19:26:38 UTC (rev 8571) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/journal/ITask.java 2014-07-17 20:58:48 UTC (rev 8572) @@ -39,7 +39,6 @@ * Interface available to tasks running under the {@link ConcurrencyManager}. * * @author <a href="mailto:tho...@us...">Bryan Thompson</a> - * @version $Id$ */ public interface ITask<T> extends Callable<T> { @@ -47,7 +46,7 @@ * The object used to manage access to the resources from which views of the * indices are created. */ - public IResourceManager getResourceManager(); + IResourceManager getResourceManager(); /** * The journal against which the operation will be carried out. @@ -75,12 +74,12 @@ * * @see IResourceManager#getJournal(long) */ - public IJournal getJournal(); + IJournal getJournal(); /** * Returns a copy of the array of resources declared to the constructor. */ - public String[] getResource(); + String[] getResource(); /** * Return the only declared resource. @@ -90,12 +89,13 @@ * @exception IllegalStateException * if more than one resource was declared. */ - public String getOnlyResource(); + String getOnlyResource(); /** - * Returns Task{taskName,timestamp,resource[]} + * Returns <code>Task{taskName,timestamp,resource[]}</code> */ - public String toString(); + @Override + String toString(); /** * Return an appropriate view of the named index for the operation. @@ -137,12 +137,14 @@ * @exception IllegalStateException * if the named index is not one of the resources declared to * the constructor. + * + * @see IGISTLocalManager */ - public IIndex getIndex(String name); + IIndex getIndex(String name); // non-GIST /** * The object used to track events and times for the task. */ - public TaskCounters getTaskCounters(); + TaskCounters getTaskCounters(); } Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/journal/IndexProcedureTask.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/journal/IndexProcedureTask.java 2014-07-17 19:26:38 UTC (rev 8571) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/journal/IndexProcedureTask.java 2014-07-17 20:58:48 UTC (rev 8572) @@ -33,14 +33,13 @@ * on an {@link IConcurrencyManager}. * * @author <a href="mailto:tho...@us...">Bryan Thompson</a> - * @version $Id$ */ -public class IndexProcedureTask extends AbstractTask { +public class IndexProcedureTask<T> extends AbstractTask<T> { - protected final IIndexProcedure proc; + private final IIndexProcedure<T> proc; public IndexProcedureTask(ConcurrencyManager concurrencyManager, - long startTime, String name, IIndexProcedure proc) { + long startTime, String name, IIndexProcedure<T> proc) { super(concurrencyManager, startTime, name); @@ -51,7 +50,8 @@ } - final public Object doTask() throws Exception { + @Override + final public T doTask() throws Exception { return proc.apply(getIndex(getOnlyResource())); @@ -60,6 +60,7 @@ /** * Returns the name of the {@link IIndexProcedure} that is being executed. */ + @Override final protected String getTaskName() { return proc.getClass().getName(); Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/journal/TemporaryStore.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/journal/TemporaryStore.java 2014-07-17 19:26:38 UTC (rev 8571) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/journal/TemporaryStore.java 2014-07-17 20:58:48 UTC (rev 8572) @@ -64,7 +64,6 @@ * weight precisely because it does not provide concurrency control. * * @author <a href="mailto:tho...@us...">Bryan Thompson</a> - * @version $Id$ * * @see <a href="https://sourceforge.net/apps/trac/bigdata/ticket/585" > GIST </a> */ Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/service/MetadataService.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/service/MetadataService.java 2014-07-17 19:26:38 UTC (rev 8571) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/service/MetadataService.java 2014-07-17 20:58:48 UTC (rev 8572) @@ -1192,7 +1192,7 @@ /** * @parma fed - * @param journal + * @param concurrencyManager * @param name * The name of the metadata index for some scale-out index. */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tob...@us...> - 2014-07-17 19:26:41
|
Revision: 8571 http://sourceforge.net/p/bigdata/code/8571 Author: tobycraig Date: 2014-07-17 19:26:38 +0000 (Thu, 17 Jul 2014) Log Message: ----------- Hide health tab for standalone deployments Modified Paths: -------------- branches/BIGDATA_RELEASE_1_3_0/bigdata-war/src/html/css/style.css branches/BIGDATA_RELEASE_1_3_0/bigdata-war/src/html/js/workbench.js Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata-war/src/html/css/style.css =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-war/src/html/css/style.css 2014-07-17 19:08:47 UTC (rev 8570) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-war/src/html/css/style.css 2014-07-17 19:26:38 UTC (rev 8571) @@ -347,6 +347,11 @@ box-sizing: border-box; } +/* workbench checks if we're in HA mode and shows health tab if we are */ +#tab-selector a[data-target=health] { + display: none; +} + .health-good { background-color: lightgreen; } Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata-war/src/html/js/workbench.js =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-war/src/html/js/workbench.js 2014-07-17 19:08:47 UTC (rev 8570) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-war/src/html/js/workbench.js 2014-07-17 19:26:38 UTC (rev 8571) @@ -1545,6 +1545,15 @@ }) } +function showHealthTab() { + $.get('/status?health', function(data) { + if(data.deployment == 'HA') { + $('#tab-selector a[data-target=health]').show(); + } + }); +} +showHealthTab(); + /* Performance */ $('#tab-selector a[data-target=performance]').click(loadPerformance); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tob...@us...> - 2014-07-17 19:08:55
|
Revision: 8570 http://sourceforge.net/p/bigdata/code/8570 Author: tobycraig Date: 2014-07-17 19:08:47 +0000 (Thu, 17 Jul 2014) Log Message: ----------- Tidied up namespaces list into table Modified Paths: -------------- branches/BIGDATA_RELEASE_1_3_0/bigdata-war/src/html/index.html branches/BIGDATA_RELEASE_1_3_0/bigdata-war/src/html/js/workbench.js Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata-war/src/html/index.html =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-war/src/html/index.html 2014-07-17 17:09:31 UTC (rev 8569) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-war/src/html/index.html 2014-07-17 19:08:47 UTC (rev 8570) @@ -231,7 +231,7 @@ <div class="box"> <h1>Namespaces</h1> - <ul id="namespaces-list"></ul> + <table id="namespaces-list"></table> <br> <a href="/bigdata/namespace">Download VoID description of all namespaces</a> </div> Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata-war/src/html/js/workbench.js =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-war/src/html/js/workbench.js 2014-07-17 17:09:31 UTC (rev 8569) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-war/src/html/js/workbench.js 2014-07-17 19:08:47 UTC (rev 8570) @@ -132,27 +132,27 @@ } else { use = '<a href="#" class="use-namespace">Use</a>'; } - $('#namespaces-list').append('<li data-name="' + title + '">' + titleText + ' - ' + use + ' - <a href="#" class="delete-namespace">Delete</a> - <a href="#" class="namespace-properties">Properties</a> - <a href="#" class="clone-namespace">Clone</a> - <a href="' + RO_URL_PREFIX + 'namespace/' + title + '/sparql" class="namespace-service-description">Service Description</a></li>'); + $('#namespaces-list').append('<tr data-name="' + title + '">><td>' + titleText + '</td><td>' + use + '</td><td><a href="#" class="delete-namespace">Delete</a></td><td><a href="#" class="namespace-properties">Properties</a></td><td><a href="#" class="clone-namespace">Clone</a></td><td><a href="' + RO_URL_PREFIX + 'namespace/' + title + '/sparql" class="namespace-service-description">Service Description</a></td></tr>'); } $('.use-namespace').click(function(e) { e.preventDefault(); - useNamespace($(this).parent().data('name')); + useNamespace($(this).parents('tr').data('name')); }); $('.delete-namespace').click(function(e) { e.preventDefault(); - deleteNamespace($(this).parent().data('name')); + deleteNamespace($(this).parents('tr').data('name')); }); $('.namespace-properties').click(function(e) { e.preventDefault(); - getNamespaceProperties($(this).parent().data('name')); + getNamespaceProperties($(this).parents('tr').data('name')); }); $('.namespace-properties-java').click(function(e) { e.preventDefault(); - getNamespaceProperties($(this).parent().data('name'), 'java'); + getNamespaceProperties($(this).parents('tr').data('name'), 'java'); }); $('.clone-namespace').click(function(e) { e.preventDefault(); - cloneNamespace($(this).parent().data('name')); + cloneNamespace($(this).parents('tr').data('name')); $('#namespace-create-errors').html(''); }); $('.namespace-service-description').click(function(e) { @@ -167,7 +167,7 @@ if(!NAMESPACES_READY) { setTimeout(function() { selectNamespace(name); }, 10); } else { - $('#namespaces-list li[data-name=' + name + '] a.use-namespace').click(); + $('#namespaces-list tr[data-name=' + name + '] a.use-namespace').click(); } } @@ -257,12 +257,9 @@ if(!name) { errors.push('Enter a name'); } - $('#namespaces-list li').each(function() { - if(name == $(this).data('name')) { - errors.push('Name already in use'); - return false; - } - }); + if($('#namespaces-list tr[data-name=' + name + ']').length != 0) { + errors.push('Name already in use'); + } if($('#new-namespace-mode').val() == 'quads' && $('#new-namespace-inference').is(':checked')) { errors.push('Inference is incompatible with quads mode'); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tob...@us...> - 2014-07-17 17:09:39
|
Revision: 8569 http://sourceforge.net/p/bigdata/code/8569 Author: tobycraig Date: 2014-07-17 17:09:31 +0000 (Thu, 17 Jul 2014) Log Message: ----------- Improved explore tab to treat URIs without <> as namespaced only if they match one of the defined namespaces, allowing user to enter non-namespaced URIs without <> Modified Paths: -------------- branches/BIGDATA_RELEASE_1_3_0/bigdata-war/src/html/js/workbench.js Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata-war/src/html/js/workbench.js =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-war/src/html/js/workbench.js 2014-07-17 15:46:25 UTC (rev 8568) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-war/src/html/js/workbench.js 2014-07-17 17:09:31 UTC (rev 8569) @@ -1171,8 +1171,15 @@ e.preventDefault(); var uri = $(this).find('input[type="text"]').val().trim(); if(uri) { - // add < > if they're not present and this is not a namespaced URI - if(uri[0] != '<' && uri.match(/^\w+:\//)) { + // add < > if they're not present and this is not a URI with a recognised namespace + var namespaces = []; + for(var cat in NAMESPACE_SHORTCUTS) { + for(var namespace in NAMESPACE_SHORTCUTS[cat]) { + namespaces.push(namespace); + } + } + var namespaced = '^(' + namespaces.join('|') + '):'; + if(uri[0] != '<' && !uri.match(namespaced)) { uri = '<' + uri; if(uri.slice(-1) != '>') { uri += '>'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mar...@us...> - 2014-07-17 15:46:28
|
Revision: 8568 http://sourceforge.net/p/bigdata/code/8568 Author: martyncutcher Date: 2014-07-17 15:46:25 +0000 (Thu, 17 Jul 2014) Log Message: ----------- Add allocation strategy to reduce IOPs by allocating small slots from sparsely allocated regions. This enables the BufferedWrite to join adjacent slot writes into a single IO. Ticket #986 Modified Paths: -------------- branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/io/writecache/BufferedWrite.java branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/io/writecache/IBufferedWriter.java branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/io/writecache/WriteCacheCounters.java branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/rwstore/FixedAllocator.java branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/rwstore/RWStore.java branches/BIGDATA_RELEASE_1_3_0/bigdata/src/test/com/bigdata/rwstore/TestRWJournal.java Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/io/writecache/BufferedWrite.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/io/writecache/BufferedWrite.java 2014-07-17 14:57:42 UTC (rev 8567) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/io/writecache/BufferedWrite.java 2014-07-17 15:46:25 UTC (rev 8568) @@ -31,10 +31,12 @@ import com.bigdata.counters.CAT; import com.bigdata.counters.CounterSet; +import com.bigdata.counters.Instrument; import com.bigdata.io.DirectBufferPool; import com.bigdata.io.FileChannelUtility; import com.bigdata.io.IBufferAccess; import com.bigdata.io.IReopenChannel; +import com.bigdata.rwstore.RWStore; /** * The BufferedWrite merges/elides sorted scattered writes to minimize IO @@ -88,12 +90,7 @@ */ private long m_endAddr = 0; - /* - * Counters. - */ - private final CAT m_dataBytes = new CAT(); - private final CAT m_dataWrites = new CAT(); - private final CAT m_fileWrites = new CAT(); + private final RWStore.StoreCounters<?> m_storeCounters; public BufferedWrite(final IBufferedWriter store) throws InterruptedException { @@ -102,6 +99,8 @@ m_store = store; + m_storeCounters = m_store.getStoreCounters(); + m_data.set( DirectBufferPool.INSTANCE.acquire() ); } @@ -162,7 +161,7 @@ public int write(final long offset, final ByteBuffer data, final IReopenChannel<FileChannel> opener) throws IOException { - m_dataWrites.increment(); + m_storeCounters.bufferDataWrites++; final int data_len = data.remaining(); final int slot_len = m_store.getSlotSize(data_len); @@ -239,12 +238,12 @@ } // increment by the amount of data currently in the buffer. - m_dataBytes.add( m_data.position() ); + m_storeCounters.bufferDataBytes += m_data.position(); // write out the data in the buffer onto the backing channel. m_data.flip(); final int nwrites = FileChannelUtility.writeAll(opener, m_data, m_startAddr); - m_fileWrites.add(nwrites); + m_storeCounters.bufferFileWrites += nwrites; reset(); @@ -280,19 +279,19 @@ public String getStats(final StringBuffer buf, final boolean reset) { - final String ret = "BufferedWrites, data: " + m_dataWrites + ", file: " + m_fileWrites + ", bytes: " + m_dataBytes; + final String ret = "BufferedWrites, data: " + m_storeCounters.bufferDataWrites + ", file: " + m_storeCounters.bufferFileWrites + ", bytes: " + m_storeCounters.bufferDataBytes; if (buf != null) { buf.append(ret + "\n"); } if (reset) { - m_dataBytes.set(0L); - m_fileWrites.set(0L); - m_dataWrites.set(0L); + m_storeCounters.bufferFileWrites = 0; + m_storeCounters.bufferDataWrites = 0; + m_storeCounters.bufferDataBytes = 0; } return ret; - } + } } Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/io/writecache/IBufferedWriter.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/io/writecache/IBufferedWriter.java 2014-07-17 14:57:42 UTC (rev 8567) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/io/writecache/IBufferedWriter.java 2014-07-17 15:46:25 UTC (rev 8568) @@ -1,7 +1,11 @@ package com.bigdata.io.writecache; +import com.bigdata.rwstore.RWStore; + public interface IBufferedWriter { int getSlotSize(int data_len); + RWStore.StoreCounters<?> getStoreCounters(); + } Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/io/writecache/WriteCacheCounters.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/io/writecache/WriteCacheCounters.java 2014-07-17 14:57:42 UTC (rev 8567) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/io/writecache/WriteCacheCounters.java 2014-07-17 15:46:25 UTC (rev 8568) @@ -182,7 +182,7 @@ setValue(elapsedWriteNanos / 1000000000.); } }); - + return root; } // getCounters() Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/rwstore/FixedAllocator.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/rwstore/FixedAllocator.java 2014-07-17 14:57:42 UTC (rev 8567) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/rwstore/FixedAllocator.java 2014-07-17 15:46:25 UTC (rev 8568) @@ -49,7 +49,7 @@ public class FixedAllocator implements Allocator { private static final Logger log = Logger.getLogger(FixedAllocator.class); - + private final int cModAllocation = 1 << RWStore.ALLOCATION_SCALEUP; private final int cMinAllocation = cModAllocation * 1; // must be multiple of cModAllocation @@ -204,20 +204,26 @@ private ArrayList m_freeList; public void setFreeList(final ArrayList list) { - m_freeList = list; + if (m_freeList != list) { + m_freeList = list; + m_freeWaiting = true; + } - if (!m_pendingContextCommit && hasFree()) { - m_freeList.add(this); - m_freeWaiting = false; + if (!m_pendingContextCommit && hasFree() && meetsSmallSlotThreshold()) { + addToFreeList(); } + } /** * To support postHACommit an allocator can be removed from the current freelist */ void removeFromFreeList() { - if (m_freeList != null) + if (m_freeList != null) { + // log.warn("Removing allocator " + m_index + " from free list"); m_freeList.remove(this); + m_freeWaiting = true; + } } @@ -405,9 +411,13 @@ final int calcFree = calcFreeBits(); final int calcLiveFree = calcLiveFreeBits(); - return m_freeBits == calcFree + final boolean ret = m_freeBits == calcFree && (m_freeBits + m_freeTransients) == calcLiveFree; + + if (!ret) + throw new AssertionError("m_free: " + m_freeBits + ", calcFree: " + calcFree); + return ret; } // read does not read in m_size since this is read to determine the class of @@ -466,6 +476,13 @@ private int m_startAddr = 0; private int m_endAddr = 0; + + /** + * For "small slot" allocators the allocation search is + * always from bit areas with less than a maximum density to + * ensure that writes have better locality. + */ + int m_allocIndex = -1; /** * The #of int32 values in a single {@link AllocBlock} region. The @@ -533,6 +550,51 @@ } /** + * find the allocationIndex of first "sparsely committed" AllocBlock. + * + * Checks the committed bits of all the AllocBlocks until one is found with + * > 50% free (or less than 50% allocated) of the committed bits. + * @param store + * @param i + */ + void resetAllocIndex() { + resetAllocIndex(0); + } + + void resetAllocIndex(final int start) { + m_allocIndex = start; + + if (m_size <= 1024) { + for (int a = m_allocIndex/m_bitSize; a < m_allocBlocks.size(); a++) { + final AllocBlock ab = m_allocBlocks.get(a); + + checkBlock(ab); + + for (int i = (m_allocIndex%m_bitSize); i < m_bitSize; i++) { + // first check if transients are already full + if (ab.m_transients[i] != 0xFFFFFFFF) { + // then check maximum 50% commit allocated + if (Integer.bitCount(ab.m_commit[i]) < 16) { + final AllocBlock abr = m_allocBlocks.get(m_allocIndex/m_bitSize); + assert abr == ab; + + return; + } + } + m_allocIndex++; + } + } + + // must remove from free list if we cannot set the alloc Index for a small slot + if (start == 0) { + removeFromFreeList(); + } else { + resetAllocIndex(0); + } + } + } + + /** * This determines the size of the reservation required in terms of * the number of ints each holding bits for 32 slots. * @@ -693,6 +755,7 @@ try { if (log.isDebugEnabled()) checkBits(); + if (((AllocBlock) m_allocBlocks.get(block)) .freeBit(offset % nbits, m_sessionActive && !overideSession)) { // bit adjust @@ -721,7 +784,7 @@ if (log.isDebugEnabled()) checkBits(); - return true; + return true; } else if (addr >= m_startAddr && addr < m_endAddr) { final Iterator<AllocBlock> iter = m_allocBlocks.iterator(); @@ -755,112 +818,227 @@ private void checkFreeList() { if (m_freeWaiting && !m_pendingContextCommit) { - if (m_freeBits >= m_store.cDefaultFreeBitsThreshold) { - m_freeWaiting = false; + if (meetsSmallSlotThreshold()) { - if (log.isDebugEnabled()) - log.debug("Returning Allocator to FreeList - " + m_size); + addToFreeList(); - m_freeList.add(this); + resetAllocIndex(0); } } } + + private void addToFreeList() { + assert m_freeWaiting; + + m_freeWaiting = false; + m_freeList.add(this); + m_allocIndex = -1; + + if (log.isDebugEnabled()) + log.debug("Returning Allocator to FreeList - " + m_size); + } + + private boolean meetsSmallSlotThreshold() { + // check threshold for all slots + if (m_freeBits < m_store.cDefaultFreeBitsThreshold) { + return false; + } + + // then check for small slots + if (m_size <= m_store.cSmallSlot) { // it's a small slotSMALL_SLOT_TYPE + return m_freeBits > m_store.cSmallSlotThreshold; + } else { + return true; + } + } /** * The introduction of IAllocationContexts has added some complexity to * the older concept of a free list. With AllocationContexts it is * possibly for allocator to have free space available but this being - * restricted to a specific AllocaitonContext. The RWStore alloc method - * must therefore handle the + * restricted to a specific AllocationContext. + * <p> + * In addition to the standard free allocation search we want to add a + * "density" restriction for small slots to encourage the aggregation + * of writes (by increasing the likelihood of sibling slot allocation). + * <p> + * There is some "Do What I mean" complexity here, with difficulty in + * determining a good rule to identify an initial allocation point. There + * is a danger of significantly reducing the allocation efficiency of + * short transactions if we too naively check committed bit density. We + * should only do this when identifying the initial allocation, and when + * the allocIndex is incremented. */ - public int alloc(final RWStore store, final int size, final IAllocationContext context) { + public int alloc(final RWStore store, final int size, + final IAllocationContext context) { try { - if (size <= 0) - throw new IllegalArgumentException( - "Allocate requires positive size, got: " + size); + if (size <= 0) + throw new IllegalArgumentException( + "Allocate requires positive size, got: " + size); - if (size > m_size) - throw new IllegalArgumentException( - "FixedAllocator with slots of " + m_size - + " bytes requested allocation for "+ size + " bytes"); + if (size > m_size) + throw new IllegalArgumentException( + "FixedAllocator with slots of " + m_size + + " bytes requested allocation for " + size + + " bytes"); - int addr = -1; + if (m_freeBits == 0) { + throw new IllegalStateException("Request to allocate from " + m_size + "byte slot FixedAllocator with zero bits free - should not be on the Free List"); + } + + int addr = -1; + + // Special allocation for small slots + if (m_size <= m_store.cSmallSlot) { + return allocFromIndex(size); + } - final Iterator<AllocBlock> iter = m_allocBlocks.iterator(); - int count = -1; - while (addr == -1 && iter.hasNext()) { - count++; + final Iterator<AllocBlock> iter = m_allocBlocks.iterator(); + int count = -1; + while (addr == -1 && iter.hasNext()) { + count++; - final AllocBlock block = iter.next(); - if (block.m_addr == 0) { - int blockSize = 32 * m_bitSize; + final AllocBlock block = iter.next(); + checkBlock(block); + + addr = block.alloc(m_size); + } + + if (addr != -1) { + + addr += 3; // Tweak to ensure non-zero address for offset 0 + + if (--m_freeBits == 0) { + if (log.isTraceEnabled()) + log.trace("Remove from free list"); + removeFromFreeList(); + + // Should have been first on list, now check for first + if (m_freeList.size() > 0) { + if (log.isDebugEnabled()) { + final FixedAllocator nxt = (FixedAllocator) m_freeList + .get(0); + log.debug("Freelist head: " + nxt.getSummaryStats()); + } + } + } + + addr += (count * 32 * m_bitSize); + + final int value = -((m_index << RWStore.OFFSET_BITS) + addr); + if (m_statsBucket != null) { - m_statsBucket.addSlots(blockSize); + m_statsBucket.allocate(size); } - blockSize *= m_size; - blockSize >>= RWStore.ALLOCATION_SCALEUP; - block.m_addr = grabAllocation(store, blockSize); - if (log.isDebugEnabled()) - log.debug("Allocation block at " + block.m_addr + " of " + (blockSize << 16) + " bytes"); + return value; + } else { + StringBuilder sb = new StringBuilder(); + sb.append("FixedAllocator returning null address, with freeBits: " + + m_freeBits + "\n"); - if (m_startAddr == 0) { - m_startAddr = block.m_addr; + for (AllocBlock ab : m_allocBlocks) { + sb.append(ab.show() + "\n"); } - m_endAddr = block.m_addr - blockSize; + + log.error(sb); + + return 0; } - addr = block.alloc(m_size); + } finally { + if (log.isDebugEnabled()) + checkBits(); } + } + + void checkBlock(final AllocBlock block) { + if (block.m_addr == 0) { + int blockSize = 32 * m_bitSize; + if (m_statsBucket != null) { + m_statsBucket.addSlots(blockSize); + } + blockSize *= m_size; + blockSize >>= RWStore.ALLOCATION_SCALEUP; - if (addr != -1) { + block.m_addr = grabAllocation(m_store, blockSize); + if (log.isDebugEnabled()) + log.debug("Allocation block at " + block.m_addr + + " of " + (blockSize << 16) + " bytes"); - addr += 3; // Tweak to ensure non-zero address for offset 0 - - if (--m_freeBits == 0) { - if (log.isTraceEnabled()) - log.trace("Remove from free list"); - m_freeList.remove(this); - m_freeWaiting = true; - - // Should have been first on list, now check for first - if (m_freeList.size() > 0) { - if (log.isDebugEnabled()) { - final FixedAllocator nxt = (FixedAllocator) m_freeList.get(0); - log.debug("Freelist head: " + nxt.getSummaryStats()); - } - } + if (m_startAddr == 0) { + m_startAddr = block.m_addr; } + m_endAddr = block.m_addr - blockSize; + } - addr += (count * 32 * m_bitSize); - - final int value = -((m_index << RWStore.OFFSET_BITS) + addr); + } + + int allocFromIndex(final int size) { + + if (m_allocIndex == -1) { + resetAllocIndex(); - if (m_statsBucket != null) { - m_statsBucket.allocate(size); + if (m_allocIndex == -1) { + throw new AssertionError("Unable to set AllocIndex with m_freeBits: " + m_freeBits); } - - - return value; - } else { - StringBuilder sb = new StringBuilder(); - sb.append("FixedAllocator returning null address, with freeBits: " + m_freeBits + "\n"); + } - for (AllocBlock ab: m_allocBlocks) { - sb.append(ab.show() + "\n"); - } - - log.error(sb); + if (log.isDebugEnabled()) + checkBits(); - return 0; + + if (m_freeBits != calcFreeBits()) { + final int calc = calcFreeBits(); + throw new AssertionError("m_freeBits != calcFreeBits() : " + m_freeBits + "!=" + calc); } - } finally { - if (log.isDebugEnabled()) - checkBits(); + + // there MUST be bits free in the m_allocIndex block + final AllocBlock ab = m_allocBlocks.get(m_allocIndex/m_bitSize); + + if (ab.m_addr == 0) { + throw new AssertionError("No allocation for AllocBlock with m_allocIndex: " + m_allocIndex); } + + final int abblock = m_allocIndex % m_bitSize; + + assert ab.m_transients[abblock] != 0xFFFFFFFF; // not all set + + final int bit = RWStore.fndBit(ab.m_transients[abblock]); + + assert bit >= 0; + + m_freeBits--; + + final int abit = (abblock*32) + bit; + RWStore.setBit(ab.m_live, abit); + RWStore.setBit(ab.m_transients, abit); + + // Note +3 for address teak for special low order bits + final int addr = -((m_index << RWStore.OFFSET_BITS) + (m_allocIndex*32) + (bit + 3)); + + // Now check current index + if (ab.m_transients[abblock] == 0xFFFFFFFF) { + // find next allocIndex + resetAllocIndex(m_allocIndex+1); + } + + if (m_freeBits != calcFreeBits()) { + throw new AssertionError("m_freeBits != calcFreeBits()"); + } + // assert m_freeBits == calcFreeBits(); + + if (m_statsBucket != null) { + m_statsBucket.allocate(size); + } + + return addr; } protected int grabAllocation(RWStore store, int blockSize) { - return store.allocBlock(blockSize); + + final int ret = store.allocBlock(blockSize); + + return ret; } public boolean hasFree() { @@ -1040,9 +1218,16 @@ } m_freeTransients = transientbits(); + m_freeBits = calcFreeBits(); + // Ensure allocIndex is reset + m_allocIndex = -1; + assert calcSessionFrees(); + if (log.isDebugEnabled()) + checkBits(); + return isolatedWrites; } @@ -1145,6 +1330,8 @@ } ab.setBitExternal(bit); + + m_freeBits--; } public int getSlotSize() { @@ -1231,8 +1418,8 @@ if (m_pendingContextCommit) { m_pendingContextCommit = false; - if (hasFree()) { - m_freeList.add(this); + if (m_freeWaiting && meetsSmallSlotThreshold()) { + addToFreeList(); } } @@ -1241,15 +1428,17 @@ // Handle re-addition to free list once transient frees are // added back - if (m_freeWaiting && m_freeBits >= m_store.cDefaultFreeBitsThreshold) { - m_freeList.add(this); - m_freeWaiting = false; + if (m_freeWaiting && meetsSmallSlotThreshold()) { + addToFreeList(); } m_freeTransients = 0; } + if (log.isDebugEnabled()) + checkBits(); + } /* Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/rwstore/RWStore.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/rwstore/RWStore.java 2014-07-17 14:57:42 UTC (rev 8567) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/rwstore/RWStore.java 2014-07-17 15:46:25 UTC (rev 8568) @@ -67,6 +67,7 @@ import com.bigdata.btree.ITupleIterator; import com.bigdata.btree.IndexMetadata; import com.bigdata.cache.ConcurrentWeakValueCache; +import com.bigdata.counters.CAT; import com.bigdata.counters.CounterSet; import com.bigdata.counters.Instrument; import com.bigdata.counters.striped.StripedCounters; @@ -357,6 +358,24 @@ String DEFAULT_FREE_BITS_THRESHOLD = "300"; /** + * Defines the size of a slot that defines it as a small slot. + * <p> + * Any slot equal to or less than this is considered a small slot and + * its availability for allocation is restricted to ensure a high + * chance that contiguous allocations can be made. + * <p> + * This is arranged by only returning small slot allocators to the free list + * if they have greater than 50% available slots, and then only allocating + * slots from sparse regions with >= 50% free/committed bits. + * <p> + * Small slot processing can be disabled by setting the smallSlotType to zero. + */ + String SMALL_SLOT_TYPE = RWStore.class.getName() + ".smallSlotType"; + + // String DEFAULT_SMALL_SLOT_TYPE = "1024"; // standard default + String DEFAULT_SMALL_SLOT_TYPE = "0"; // initial default to no special processing + + /** * When <code>true</code>, scattered writes which are strictly ascending * will be coalesced within a buffer and written out as a single IO * (default {@value #DEFAULT_DOUBLE_BUFFER_WRITES}). This improves write @@ -820,7 +839,16 @@ throw new IllegalArgumentException(Options.FREE_BITS_THRESHOLD + " : Must be between 1 and 5000"); } - + + cSmallSlot = Integer.valueOf(fileMetadata.getProperty( + Options.SMALL_SLOT_TYPE, + Options.DEFAULT_SMALL_SLOT_TYPE)); + + if (cSmallSlot < 0 || cSmallSlot > 2048) { + throw new IllegalArgumentException(Options.SMALL_SLOT_TYPE + + " : Must be between 0 and 2048"); + } + m_metaBits = new int[m_metaBitsSize]; m_metaTransientBits = new int[m_metaBitsSize]; @@ -2117,37 +2145,13 @@ // With a non-null WCS, the actual read should be via a callback to readRaw, it should not get here // unless it is not possible to cache - but maybe even then the WCS should read into a temporary // buffer - final long beginDisk = System.nanoTime(); - // If checksum is required then the buffer should be sized to include checksum in final 4 bytes + + // If checksum is required then the buffer should be sized to include checksum in final 4 bytes final ByteBuffer bb = ByteBuffer.wrap(buf, offset, length); // Use ReadRaw - should be the same read all readRaw(paddr, bb); - // enable for debug - if (false) {//FIXME EXTENSION_LOCK REQUIRED FOR IO. - final byte[] nbuf = new byte[buf.length]; - final ByteBuffer nbb = ByteBuffer.wrap(nbuf, offset, length); - FileChannelUtility.readAll(m_reopener, nbb, paddr); - if (!Arrays.equals(buf, nbuf)) - throw new AssertionError(); - - m_diskReads++; - // Update counters. - final StoreCounters<?> c = (StoreCounters<?>) storeCounters.get() - .acquire(); - try { - final int nbytes = length; - c.nreads++; - c.bytesRead += nbytes; - c.bytesReadFromDisk += nbytes; - c.elapsedReadNanos += (System.nanoTime() - begin); - c.elapsedDiskReadNanos += (System.nanoTime() - beginDisk); - } finally { - c.release(); - } - } - final int chk = ChecksumUtility.getCHK().checksum(buf, offset, length-4); // read checksum final int tstchk = bb.getInt(offset + length-4); if (chk != tstchk) { @@ -2669,6 +2673,10 @@ } final int addr = allocator.alloc(this, size, context); + + if (addr == 0) { + throw new IllegalStateException("Free Allocator unable to allocate address: " + allocator.getSummaryStats()); + } if (allocator.isUnlocked() && !m_commitList.contains(allocator)) { m_commitList.add(allocator); @@ -3360,7 +3368,7 @@ + m_metaBitsAddr + ", active contexts: " + m_contexts.size()); - if (log.isDebugEnabled() && m_quorum.isHighlyAvailable()) { + if (log.isDebugEnabled() && m_quorum != null && m_quorum.isHighlyAvailable()) { log.debug(showAllocatorList()); @@ -3624,6 +3632,10 @@ */ final int cDefaultFreeBitsThreshold; + final int cSmallSlotThreshold = 4096; // debug test + + int cSmallSlot = 1024; // @see from Options#SMALL_SLOT_TYPE + /** * Each "metaBit" is a file region */ @@ -3952,7 +3964,7 @@ private void extendFile() { final int adjust = -1200 + (m_fileSize / 10); - + extendFile(adjust); } @@ -4050,12 +4062,21 @@ static int fndBit(final int[] bits, final int offset, final int size) { final int eob = size + offset; - for (int i = offset; i < eob; i++) { - if (bits[i] != 0xFFFFFFFF) { - for (int k = 0; k < 32; k++) { - if ((bits[i] & (1 << k)) == 0) { - return (i * 32) + k; - } + for (int i = offset; i < eob; i++) { + final int b = fndBit(bits[i]); + if (b != -1) { + return (i * 32) + b; + } + } + + return -1; + } + + static int fndBit(final int bits) { + if (bits != 0xFFFFFFFF) { + for (int k = 0; k < 32; k++) { + if ((bits & (1 << k)) == 0) { + return k; } } } @@ -5493,19 +5514,27 @@ * #of times one of the root blocks has been written. */ public volatile long nwriteRootBlock; + + /** + * buffer counters + */ + public volatile long bufferDataBytes; + public volatile long bufferDataWrites; + public volatile long bufferFileWrites; /** * {@inheritDoc} */ public StoreCounters() { - super(); + super(); } - /** + /** * {@inheritDoc} */ public StoreCounters(final int batchSize) { super(batchSize); + } /** @@ -5602,7 +5631,6 @@ ntruncate = 0; nreopen = 0; nwriteRootBlock = 0; - } @Override @@ -5695,9 +5723,25 @@ } }); + } // IRawStore - // disk statistics + // BufferedWriter + final CounterSet bc = root.makePath("buffer"); + + bc.addCounter("ndataWrites", new Instrument<Long>() { + public void sample() { + setValue(bufferDataWrites); + } + }); + + bc.addCounter("nfileWrites", new Instrument<Long>() { + public void sample() { + setValue(bufferFileWrites); + } + }); + + // disk statistics { final CounterSet disk = root.makePath("disk"); @@ -6180,19 +6224,32 @@ final int position = dst.position(); try { + final long beginDisk = System.nanoTime(); + // the offset into the disk file. // final long pos = FileMetadata.headerSize0 + offset; final long pos = offset; + final int length = dst.limit(); // read on the disk. final int ndiskRead = FileChannelUtility.readAll(m_reopener, dst, pos); + m_diskReads += ndiskRead; + + final long now = System.nanoTime(); + // update performance counters. final StoreCounters<?> c = (StoreCounters<?>) storeCounters .get().acquire(); try { c.ndiskRead += ndiskRead; + final int nbytes = length; + c.nreads++; + c.bytesRead += nbytes; + c.bytesReadFromDisk += nbytes; + c.elapsedReadNanos += now - beginDisk; + c.elapsedDiskReadNanos += now - beginDisk; } finally { c.release(); } Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata/src/test/com/bigdata/rwstore/TestRWJournal.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata/src/test/com/bigdata/rwstore/TestRWJournal.java 2014-07-17 14:57:42 UTC (rev 8567) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata/src/test/com/bigdata/rwstore/TestRWJournal.java 2014-07-17 15:46:25 UTC (rev 8568) @@ -639,6 +639,26 @@ } + protected IRawStore getSmallSlotStore() { + + return getSmallSlotStore(0); + + } + + protected IRawStore getSmallSlotStore(final int slotSize) { + + final Properties properties = new Properties(getProperties()); + + properties.setProperty( + AbstractTransactionService.Options.MIN_RELEASE_AGE, "0"); + + properties.setProperty( + RWStore.Options.SMALL_SLOT_TYPE, "" + slotSize); + + return getStore(properties); + + } + protected Journal getStore(final long retentionMillis) { final Properties properties = new Properties(getProperties()); @@ -830,6 +850,114 @@ } /** + * Ensures the allocation of unique addresses by mapping allocated + * address with uniqueness assertion against physical address. + */ + public void test_addressingContiguous() { + + final Journal store = (Journal) getStore(); + + try { + + final RWStrategy bufferStrategy = (RWStrategy) store.getBufferStrategy(); + + final RWStore rw = bufferStrategy.getStore(); + final int cSlotSize = 128; + final int cAllocSize = 99; + + long pap = rw.physicalAddress(rw.alloc(cAllocSize, null)); + for (int i = 0; i < 500000; i++) { + final int a = rw.alloc(cAllocSize, null); + final long pa = rw.physicalAddress(a); + + if (pa != (pap+cSlotSize)) { + // for debug + rw.physicalAddress(a); + fail("Non-Contiguous slots: " + i + ", " + pa + "!=" + (pap+cSlotSize)); + } + + pap = pa; + + } + + store.commit(); + + final StringBuilder sb = new StringBuilder(); + rw.showAllocators(sb); + + log.warn(sb.toString()); + + } finally { + + store.destroy(); + + } + + } + + /** + * Tests the recycling of small slot alloctors and outputs statistics related + * to contiguous allocations indicative of reduced IOPS. + */ + public void test_smallSlotRecycling() { + + final Journal store = (Journal) getSmallSlotStore(1024); + + try { + + final RWStrategy bufferStrategy = (RWStrategy) store.getBufferStrategy(); + + final RWStore rw = bufferStrategy.getStore(); + final int cSlotSize = 128; + final int cAllocSize = 99; + + int breaks = 0; + int contiguous = 0; + + ArrayList<Integer> recycle = new ArrayList<Integer>(); + + long pap = rw.physicalAddress(rw.alloc(cAllocSize, null)); + for (int i = 0; i < 500000; i++) { + final int a = rw.alloc(cSlotSize, null); + final long pa = rw.physicalAddress(a); + + if (r.nextInt(7) < 5) { // more than 50% recycle + recycle.add(a); + } + + if (pa == (pap+cSlotSize)) { + contiguous++; + } else { + breaks++; + } + + pap = pa; + + if (recycle.size() > 5000) { + log.warn("Transient Frees for immediate recyling"); + for (int e : recycle) { + rw.free(e, cAllocSize); + } + recycle.clear(); + } + } + + store.commit(); + + final StringBuilder sb = new StringBuilder(); + rw.showAllocators(sb); + + log.warn("Contiguous: " + contiguous + ", breaks: " + breaks + "\n" + sb.toString()); + + } finally { + + store.destroy(); + + } + + } + + /** * Basic allocation test to ensure the FixedAllocators are operating * efficiently. * This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mrp...@us...> - 2014-07-17 14:57:53
|
Revision: 8567 http://sourceforge.net/p/bigdata/code/8567 Author: mrpersonick Date: 2014-07-17 14:57:42 +0000 (Thu, 17 Jul 2014) Log Message: ----------- Merge 1.3 branch from 8382 to HEAD. Now at 8565. Modified Paths: -------------- branches/SESAME_2_7/bigdata/src/java/com/bigdata/Banner.java branches/SESAME_2_7/bigdata/src/java/com/bigdata/BigdataStatics.java branches/SESAME_2_7/bigdata/src/java/com/bigdata/bop/controller/SubqueryJoinAnnotations.java branches/SESAME_2_7/bigdata/src/java/com/bigdata/bop/controller/SubqueryOp.java branches/SESAME_2_7/bigdata/src/java/com/bigdata/bop/engine/AbstractRunningQuery.java branches/SESAME_2_7/bigdata/src/java/com/bigdata/bop/engine/IRunningQuery.java branches/SESAME_2_7/bigdata/src/java/com/bigdata/bop/engine/QueryDeadline.java branches/SESAME_2_7/bigdata/src/java/com/bigdata/bop/engine/QueryEngine.java branches/SESAME_2_7/bigdata/src/java/com/bigdata/bop/engine/QueryLog.java branches/SESAME_2_7/bigdata/src/java/com/bigdata/bop/paths/ArbitraryLengthPathOp.java branches/SESAME_2_7/bigdata/src/java/com/bigdata/btree/AbstractBTree.java branches/SESAME_2_7/bigdata/src/java/com/bigdata/btree/DefaultTupleSerializer.java branches/SESAME_2_7/bigdata/src/java/com/bigdata/btree/IndexMetadata.java branches/SESAME_2_7/bigdata/src/java/com/bigdata/btree/PageStats.java branches/SESAME_2_7/bigdata/src/java/com/bigdata/btree/filter/PrefixFilter.java branches/SESAME_2_7/bigdata/src/java/com/bigdata/btree/keys/ASCIIKeyBuilderFactory.java branches/SESAME_2_7/bigdata/src/java/com/bigdata/btree/keys/DefaultKeyBuilderFactory.java branches/SESAME_2_7/bigdata/src/java/com/bigdata/btree/keys/IKeyBuilderFactory.java branches/SESAME_2_7/bigdata/src/java/com/bigdata/btree/keys/ThreadLocalKeyBuilderFactory.java branches/SESAME_2_7/bigdata/src/java/com/bigdata/btree/proc/IIndexProcedure.java branches/SESAME_2_7/bigdata/src/java/com/bigdata/journal/AbstractJournal.java branches/SESAME_2_7/bigdata/src/java/com/bigdata/journal/AbstractTask.java branches/SESAME_2_7/bigdata/src/java/com/bigdata/journal/CommitCounterUtility.java branches/SESAME_2_7/bigdata/src/java/com/bigdata/journal/DropIndexTask.java branches/SESAME_2_7/bigdata/src/java/com/bigdata/journal/IIndexManager.java branches/SESAME_2_7/bigdata/src/java/com/bigdata/journal/JournalTransactionService.java branches/SESAME_2_7/bigdata/src/java/com/bigdata/journal/Name2Addr.java branches/SESAME_2_7/bigdata/src/java/com/bigdata/journal/RegisterIndexTask.java branches/SESAME_2_7/bigdata/src/java/com/bigdata/journal/WriteExecutorService.java branches/SESAME_2_7/bigdata/src/java/com/bigdata/relation/AbstractRelation.java branches/SESAME_2_7/bigdata/src/java/com/bigdata/relation/locator/DefaultResourceLocator.java branches/SESAME_2_7/bigdata/src/java/com/bigdata/rwstore/RWStore.java branches/SESAME_2_7/bigdata/src/java/com/bigdata/service/AbstractTransactionService.java branches/SESAME_2_7/bigdata/src/java/com/bigdata/service/IService.java branches/SESAME_2_7/bigdata/src/java/com/bigdata/sparse/GlobalRowStoreHelper.java branches/SESAME_2_7/bigdata/src/releases/RELEASE_1_3_1.txt branches/SESAME_2_7/bigdata/src/resources/logging/log4j-dev.properties branches/SESAME_2_7/bigdata/src/resources/logging/log4j.properties branches/SESAME_2_7/bigdata/src/test/com/bigdata/bop/engine/TestQueryDeadlineOrder.java branches/SESAME_2_7/bigdata/src/test/com/bigdata/bop/engine/TestQueryEngine.java branches/SESAME_2_7/bigdata/src/test/com/bigdata/journal/AbstractMROWTestCase.java branches/SESAME_2_7/bigdata/src/test/com/bigdata/journal/StressTestConcurrentTx.java branches/SESAME_2_7/bigdata/src/test/com/bigdata/journal/StressTestConcurrentUnisolatedIndices.java branches/SESAME_2_7/bigdata/src/test/com/bigdata/journal/StressTestLockContention.java branches/SESAME_2_7/bigdata/src/test/com/bigdata/journal/StressTestUnisolatedReadWriteIndex.java branches/SESAME_2_7/bigdata/src/test/com/bigdata/journal/TestCommitCounterUtility.java branches/SESAME_2_7/bigdata/src/test/com/bigdata/journal/TestJournalBasics.java branches/SESAME_2_7/bigdata/src/test/com/bigdata/journal/TestUnisolatedWriteTasks.java branches/SESAME_2_7/bigdata/src/test/com/bigdata/journal/TestWORMStrategy.java branches/SESAME_2_7/bigdata/src/test/com/bigdata/rwstore/TestRWJournal.java branches/SESAME_2_7/bigdata/src/test/com/bigdata/service/TestAll.java branches/SESAME_2_7/bigdata-jini/src/java/com/bigdata/journal/jini/ha/HAJournal.java branches/SESAME_2_7/bigdata-jini/src/java/com/bigdata/journal/jini/ha/HAJournalServer.java branches/SESAME_2_7/bigdata-jini/src/java/com/bigdata/journal/jini/ha/HALogNexus.java branches/SESAME_2_7/bigdata-jini/src/java/com/bigdata/journal/jini/ha/SnapshotManager.java branches/SESAME_2_7/bigdata-jini/src/test/com/bigdata/journal/jini/ha/AbstractHA3JournalServerTestCase.java branches/SESAME_2_7/bigdata-jini/src/test/com/bigdata/journal/jini/ha/TestHA1JournalServer.java branches/SESAME_2_7/bigdata-jini/src/test/com/bigdata/journal/jini/ha/TestHA3SnapshotPolicy2.java branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/lexicon/LexiconRelation.java branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/lexicon/Term2IdTupleSerializer.java branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/model/BigdataValueFactoryImpl.java branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/ASTContainer.java branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/FilterNode.java branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/GroupMemberNodeBase.java branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/QueryHints.java branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/StaticAnalysis.java branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/SubqueryFunctionNodeBase.java branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/SubqueryRoot.java branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/eval/AST2BOpContext.java branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/eval/AST2BOpUtility.java branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/eval/ASTEvalHelper.java branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/eval/AbstractServiceFactory.java branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/eval/SampleServiceFactory.java branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/eval/SliceServiceFactory.java branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/eval/ValuesServiceFactory.java branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/hints/AbstractChunkSizeHint.java branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/hints/AccessPathSampleLimitHint.java branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/hints/AccessPathScanAndFilterHint.java branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/hints/AnalyticQueryHint.java branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/hints/AtOnceHint.java branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/hints/BasicBooleanQueryHint.java branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/hints/BasicDoubleQueryHint.java branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/hints/BasicIntQueryHint.java branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/hints/BasicLongQueryHint.java branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/hints/BasicStringQueryHint.java branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/hints/BufferChunkOfChunksCapacityHint.java branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/hints/CutoffLimitHint.java branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/hints/DescribeIterationLimitHint.java branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/hints/DescribeModeHint.java branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/hints/DescribeStatementLimitHint.java branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/hints/HashJoinHint.java branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/hints/IQueryHint.java branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/hints/KeyOrderHint.java branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/hints/MergeJoinHint.java branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/hints/NativeDistinctQueryHint.java branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/hints/NativeDistinctSPOHint.java branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/hints/NativeDistinctSPOThresholdHint.java branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/hints/NativeHashJoinsHint.java branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/hints/OptimisticQueryHint.java branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/hints/OptimizerQueryHint.java branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/hints/PipelineMaxMessagesPerTaskHint.java branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/hints/PipelineMaxParallelHint.java branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/hints/PipelineQueueCapacityHint.java branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/hints/QueryHintRegistry.java branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/hints/QueryIdHint.java branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/hints/RTOLimitQueryHint.java branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/hints/RTONEdgesQueryHint.java branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/hints/RTOSampleTypeQueryHint.java branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/hints/RangeHint.java branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/hints/RemoteAPHint.java branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/hints/RunFirstHint.java branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/hints/RunLastHint.java branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/hints/RunOnceHint.java branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/optimizers/ASTExistsOptimizer.java branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/optimizers/ASTQueryHintOptimizer.java branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/optimizers/StaticOptimizer.java branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/service/CustomServiceFactory.java branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/service/INativeServiceOptions.java branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/service/IServiceOptions.java branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/service/RemoteServiceCallImpl.java branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/service/ServiceCall.java branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/service/ServiceCallCreateParams.java branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/service/ServiceOptionsBase.java branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/store/AbstractTripleStore.java branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/store/BD.java branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/store/BigdataTriplePatternMaterializer.java branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/store/LocalTripleStore.java branches/SESAME_2_7/bigdata-rdf/src/test/com/bigdata/rdf/lexicon/TestCompletionScan.java branches/SESAME_2_7/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/TestAll.java branches/SESAME_2_7/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/TestNamedGraphs.java branches/SESAME_2_7/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/TestNegation.java branches/SESAME_2_7/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/TestTCK.java branches/SESAME_2_7/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/service/BigdataNativeMockServiceFactory.java branches/SESAME_2_7/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/optimizers/TestASTExistsAndJoinOrderByTypeOptimizers.java branches/SESAME_2_7/bigdata-rdf/src/test/com/bigdata/rdf/store/TestLocalTripleStore.java branches/SESAME_2_7/bigdata-rdf/src/test/com/bigdata/rdf/store/TestLocalTripleStoreDestroy.java branches/SESAME_2_7/bigdata-sails/src/java/com/bigdata/rdf/sail/BigdataSail.java branches/SESAME_2_7/bigdata-sails/src/java/com/bigdata/rdf/sail/BigdataSailFactory.java branches/SESAME_2_7/bigdata-sails/src/java/com/bigdata/rdf/sail/BigdataSailRepository.java branches/SESAME_2_7/bigdata-sails/src/java/com/bigdata/rdf/sail/remote/BigdataSailRemoteRepository.java branches/SESAME_2_7/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/BigdataRDFContext.java branches/SESAME_2_7/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/BigdataRDFServlet.java branches/SESAME_2_7/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/BigdataServlet.java branches/SESAME_2_7/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/BlueprintsServlet.java branches/SESAME_2_7/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/CountersServlet.java branches/SESAME_2_7/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/DeleteServlet.java branches/SESAME_2_7/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/DescribeCacheServlet.java branches/SESAME_2_7/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/HALoadBalancerServlet.java branches/SESAME_2_7/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/HAStatusServletUtil.java branches/SESAME_2_7/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/InsertServlet.java branches/SESAME_2_7/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/MultiTenancyServlet.java branches/SESAME_2_7/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/QueryServlet.java branches/SESAME_2_7/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/RESTServlet.java branches/SESAME_2_7/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/StatusServlet.java branches/SESAME_2_7/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/UpdateServlet.java branches/SESAME_2_7/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/WorkbenchServlet.java branches/SESAME_2_7/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/client/IMimeTypes.java branches/SESAME_2_7/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/client/RemoteRepository.java branches/SESAME_2_7/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/client/RemoteRepositoryManager.java branches/SESAME_2_7/bigdata-sails/src/test/com/bigdata/rdf/sail/AbstractBigdataSailTestCase.java branches/SESAME_2_7/bigdata-sails/src/test/com/bigdata/rdf/sail/TestBigdataSailEmbeddedFederationWithQuads.java branches/SESAME_2_7/bigdata-sails/src/test/com/bigdata/rdf/sail/TestBigdataSailWithQuads.java branches/SESAME_2_7/bigdata-sails/src/test/com/bigdata/rdf/sail/TestMROWTransactions.java branches/SESAME_2_7/bigdata-sails/src/test/com/bigdata/rdf/sail/TestMROWTransactionsNoHistory.java branches/SESAME_2_7/bigdata-sails/src/test/com/bigdata/rdf/sail/TestMROWTransactionsWithHistory.java branches/SESAME_2_7/bigdata-sails/src/test/com/bigdata/rdf/sail/tck/BigdataEmbeddedFederationSparqlTest.java branches/SESAME_2_7/bigdata-sails/src/test/com/bigdata/rdf/sail/tck/BigdataSPARQLUpdateConformanceTest.java branches/SESAME_2_7/bigdata-sails/src/test/com/bigdata/rdf/sail/tck/BigdataSparqlTest.java branches/SESAME_2_7/bigdata-sails/src/test/com/bigdata/rdf/sail/webapp/AbstractTestNanoSparqlClient.java branches/SESAME_2_7/bigdata-sails/src/test/com/bigdata/rdf/sail/webapp/TestAll.java branches/SESAME_2_7/bigdata-sails/src/test/com/bigdata/rdf/sail/webapp/TestMultiTenancyAPI.java branches/SESAME_2_7/bigdata-sails/src/test/com/bigdata/rdf/sail/webapp/TestNanoSparqlServerWithProxyIndexManager.java branches/SESAME_2_7/bigdata-sails/src/test/com/bigdata/rdf/sail/webapp/health/TestNSSHealthCheck.java branches/SESAME_2_7/bigdata-war/classes/log4j.properties branches/SESAME_2_7/bigdata-war/src/html/css/style.css branches/SESAME_2_7/bigdata-war/src/html/index.html branches/SESAME_2_7/bigdata-war/src/html/js/workbench.js branches/SESAME_2_7/bigdata-war/src/jetty.xml branches/SESAME_2_7/build.properties branches/SESAME_2_7/build.xml branches/SESAME_2_7/pom.xml branches/SESAME_2_7/src/resources/HAJournal/HAJournal.config branches/SESAME_2_7/src/resources/HAJournal/log4jHA.properties branches/SESAME_2_7/src/resources/bin/HARestore branches/SESAME_2_7/src/resources/bin/startHAServices branches/SESAME_2_7/src/resources/deployment/nss/WEB-INF/classes/log4j.properties branches/SESAME_2_7/src/resources/deployment/nss/bin/startNSS branches/SESAME_2_7/src/resources/etc/default/bigdataHA branches/SESAME_2_7/src/resources/etc/init.d/bigdataHA Added Paths: ----------- branches/SESAME_2_7/bigdata/src/java/com/bigdata/journal/IReadOnly.java branches/SESAME_2_7/bigdata/src/java/com/bigdata/rwstore/MetabitsUtil.java branches/SESAME_2_7/bigdata/src/java/com/bigdata/service/IServiceInit.java branches/SESAME_2_7/bigdata/src/test/com/bigdata/journal/TestHierarchicalLockingTasks.java branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/FilterExistsModeEnum.java branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/eval/ServiceParams.java branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/hints/FilterExistsHint.java branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/service/storedquery/ branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/service/storedquery/SimpleStoredQueryService.java branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/service/storedquery/StoredQueryService.java branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/service/storedquery/package.html branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/task/ branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/task/AbstractApiTask.java branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/task/ApiTaskForIndexManager.java branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/task/ApiTaskForJournal.java branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/task/IApiTask.java branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/task/package.html branches/SESAME_2_7/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/exists-988.trig branches/SESAME_2_7/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/exists-988a.rq branches/SESAME_2_7/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/exists-988a.srx branches/SESAME_2_7/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/exists-988b.rq branches/SESAME_2_7/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/exists-988b.srx branches/SESAME_2_7/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/exists-988c.rq branches/SESAME_2_7/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/exists-988c.srx branches/SESAME_2_7/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/exists-988d.rq branches/SESAME_2_7/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/exists-988d.srx branches/SESAME_2_7/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/stored-query-001.rq branches/SESAME_2_7/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/stored-query-001.srx branches/SESAME_2_7/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/stored-query-001.ttl branches/SESAME_2_7/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/stored-query-002.rq branches/SESAME_2_7/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/stored-query-003.rq branches/SESAME_2_7/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/service/ branches/SESAME_2_7/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/service/storedquery/ branches/SESAME_2_7/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/service/storedquery/TestAll.java branches/SESAME_2_7/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/service/storedquery/TestStoredQueryService.java branches/SESAME_2_7/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/AbstractRestApiTask.java branches/SESAME_2_7/src/resources/deployment/README.txt branches/SESAME_2_7/src/resources/deployment/brew/ branches/SESAME_2_7/src/resources/deployment/brew/bigdata.rb branches/SESAME_2_7/src/resources/deployment/chef/ branches/SESAME_2_7/src/resources/deployment/chef/README.md branches/SESAME_2_7/src/resources/deployment/chef/attributes/ branches/SESAME_2_7/src/resources/deployment/chef/attributes/default.rb branches/SESAME_2_7/src/resources/deployment/chef/metadata.rb branches/SESAME_2_7/src/resources/deployment/chef/recipes/ branches/SESAME_2_7/src/resources/deployment/chef/recipes/high_availability.rb branches/SESAME_2_7/src/resources/deployment/chef/recipes/java7.rb branches/SESAME_2_7/src/resources/deployment/chef/recipes/mapgraph.rb branches/SESAME_2_7/src/resources/deployment/chef/recipes/nss.rb branches/SESAME_2_7/src/resources/deployment/chef/recipes/ssd.rb branches/SESAME_2_7/src/resources/deployment/chef/recipes/tomcat.rb branches/SESAME_2_7/src/resources/deployment/chef/templates/ branches/SESAME_2_7/src/resources/deployment/chef/templates/default/ branches/SESAME_2_7/src/resources/deployment/chef/templates/default/RWStore.properties.erb branches/SESAME_2_7/src/resources/deployment/chef/templates/default/etc/ branches/SESAME_2_7/src/resources/deployment/chef/templates/default/etc/default/ branches/SESAME_2_7/src/resources/deployment/chef/templates/default/etc/default/bigdataHA.erb branches/SESAME_2_7/src/resources/deployment/chef/templates/default/log4j.properties.erb branches/SESAME_2_7/src/resources/deployment/chef/templates/default/log4jHA.properties.erb branches/SESAME_2_7/src/resources/deployment/chef/templates/default/zoo.cfg.erb branches/SESAME_2_7/src/resources/deployment/nss/bin/bigdataNSS branches/SESAME_2_7/src/resources/deployment/vagrant/ branches/SESAME_2_7/src/resources/deployment/vagrant/bigdata-aws-ha3-launcher/ branches/SESAME_2_7/src/resources/deployment/vagrant/bigdata-aws-ha3-launcher/README.txt branches/SESAME_2_7/src/resources/deployment/vagrant/bigdata-aws-ha3-launcher/Vagrantfile branches/SESAME_2_7/src/resources/deployment/vagrant/bigdata-aws-ha3-launcher/Vagrantfile.aws.ha3.build-from-svn branches/SESAME_2_7/src/resources/deployment/vagrant/bigdata-aws-ha3-launcher/bin/ branches/SESAME_2_7/src/resources/deployment/vagrant/bigdata-aws-ha3-launcher/bin/createCluster.sh branches/SESAME_2_7/src/resources/deployment/vagrant/bigdata-aws-ha3-launcher/bin/createSecurityGroup.py branches/SESAME_2_7/src/resources/deployment/vagrant/bigdata-aws-ha3-launcher/bin/setHosts.py branches/SESAME_2_7/src/resources/deployment/vagrant/samples/ branches/SESAME_2_7/src/resources/deployment/vagrant/samples/AWS/ branches/SESAME_2_7/src/resources/deployment/vagrant/samples/AWS/Berksfile branches/SESAME_2_7/src/resources/deployment/vagrant/samples/AWS/Gemfile branches/SESAME_2_7/src/resources/deployment/vagrant/samples/AWS/README.txt branches/SESAME_2_7/src/resources/deployment/vagrant/samples/AWS/Thorfile branches/SESAME_2_7/src/resources/deployment/vagrant/samples/AWS/Vagrantfile.aws.mapgraph branches/SESAME_2_7/src/resources/deployment/vagrant/samples/AWS/Vagrantfile.aws.nss branches/SESAME_2_7/src/resources/deployment/vagrant/samples/AWS/Vagrantfile.aws.nss.build-from-svn branches/SESAME_2_7/src/resources/deployment/vagrant/samples/AWS/Vagrantfile.aws.tomcat branches/SESAME_2_7/src/resources/deployment/vagrant/samples/AWS/Vagrantfile.aws.tomcat.build-from-svn branches/SESAME_2_7/src/resources/deployment/vagrant/samples/AWS/Vagrantfile.dual-provider.tomcat branches/SESAME_2_7/src/resources/deployment/vagrant/samples/AWS/aws.rc branches/SESAME_2_7/src/resources/deployment/vagrant/samples/AWS/chefignore branches/SESAME_2_7/src/resources/deployment/vagrant/samples/AWS/metadata.rb branches/SESAME_2_7/src/resources/deployment/vagrant/samples/VirtualBox/ branches/SESAME_2_7/src/resources/deployment/vagrant/samples/VirtualBox/Berksfile branches/SESAME_2_7/src/resources/deployment/vagrant/samples/VirtualBox/Gemfile branches/SESAME_2_7/src/resources/deployment/vagrant/samples/VirtualBox/README.txt branches/SESAME_2_7/src/resources/deployment/vagrant/samples/VirtualBox/Thorfile branches/SESAME_2_7/src/resources/deployment/vagrant/samples/VirtualBox/Vagrantfile.ha1 branches/SESAME_2_7/src/resources/deployment/vagrant/samples/VirtualBox/Vagrantfile.ha3 branches/SESAME_2_7/src/resources/deployment/vagrant/samples/VirtualBox/Vagrantfile.nss branches/SESAME_2_7/src/resources/deployment/vagrant/samples/VirtualBox/Vagrantfile.nss.build-from-svn branches/SESAME_2_7/src/resources/deployment/vagrant/samples/VirtualBox/Vagrantfile.tomcat branches/SESAME_2_7/src/resources/deployment/vagrant/samples/VirtualBox/Vagrantfile.tomcat.build-from-svn branches/SESAME_2_7/src/resources/deployment/vagrant/samples/VirtualBox/chefignore branches/SESAME_2_7/src/resources/deployment/vagrant/samples/VirtualBox/metadata.rb Removed Paths: ------------- branches/SESAME_2_7/bigdata/src/resources/deployment/ branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/service/storedquery/SimpleStoredQueryService.java branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/service/storedquery/StoredQueryService.java branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/service/storedquery/package.html branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/task/AbstractApiTask.java branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/task/ApiTaskForIndexManager.java branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/task/ApiTaskForJournal.java branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/task/IApiTask.java branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/task/package.html branches/SESAME_2_7/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/service/storedquery/ branches/SESAME_2_7/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/service/storedquery/TestAll.java branches/SESAME_2_7/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/service/storedquery/TestStoredQueryService.java branches/SESAME_2_7/src/resources/deployment/brew/bigdata.rb branches/SESAME_2_7/src/resources/deployment/chef/README.md branches/SESAME_2_7/src/resources/deployment/chef/attributes/ branches/SESAME_2_7/src/resources/deployment/chef/attributes/default.rb branches/SESAME_2_7/src/resources/deployment/chef/metadata.rb branches/SESAME_2_7/src/resources/deployment/chef/recipes/ branches/SESAME_2_7/src/resources/deployment/chef/recipes/high_availability.rb branches/SESAME_2_7/src/resources/deployment/chef/recipes/java7.rb branches/SESAME_2_7/src/resources/deployment/chef/recipes/mapgraph.rb branches/SESAME_2_7/src/resources/deployment/chef/recipes/nss.rb branches/SESAME_2_7/src/resources/deployment/chef/recipes/ssd.rb branches/SESAME_2_7/src/resources/deployment/chef/recipes/tomcat.rb branches/SESAME_2_7/src/resources/deployment/chef/templates/ branches/SESAME_2_7/src/resources/deployment/chef/templates/default/ branches/SESAME_2_7/src/resources/deployment/chef/templates/default/RWStore.properties.erb branches/SESAME_2_7/src/resources/deployment/chef/templates/default/etc/ branches/SESAME_2_7/src/resources/deployment/chef/templates/default/etc/default/ branches/SESAME_2_7/src/resources/deployment/chef/templates/default/etc/default/bigdataHA.erb branches/SESAME_2_7/src/resources/deployment/chef/templates/default/log4j.properties.erb branches/SESAME_2_7/src/resources/deployment/chef/templates/default/log4jHA.properties.erb branches/SESAME_2_7/src/resources/deployment/chef/templates/default/zoo.cfg.erb branches/SESAME_2_7/src/resources/deployment/nss/bin/bigdata branches/SESAME_2_7/src/resources/deployment/nss/etc/jetty.xml branches/SESAME_2_7/src/resources/deployment/vagrant/bigdata-aws-ha3-launcher/ branches/SESAME_2_7/src/resources/deployment/vagrant/bigdata-aws-ha3-launcher/README.txt branches/SESAME_2_7/src/resources/deployment/vagrant/bigdata-aws-ha3-launcher/Vagrantfile branches/SESAME_2_7/src/resources/deployment/vagrant/bigdata-aws-ha3-launcher/Vagrantfile.aws.ha3.build-from-svn branches/SESAME_2_7/src/resources/deployment/vagrant/bigdata-aws-ha3-launcher/bin/ branches/SESAME_2_7/src/resources/deployment/vagrant/bigdata-aws-ha3-launcher/bin/createCluster.sh branches/SESAME_2_7/src/resources/deployment/vagrant/bigdata-aws-ha3-launcher/bin/createSecurityGroup.py branches/SESAME_2_7/src/resources/deployment/vagrant/bigdata-aws-ha3-launcher/bin/setHosts.py branches/SESAME_2_7/src/resources/deployment/vagrant/samples/ branches/SESAME_2_7/src/resources/deployment/vagrant/samples/AWS/ branches/SESAME_2_7/src/resources/deployment/vagrant/samples/AWS/Berksfile branches/SESAME_2_7/src/resources/deployment/vagrant/samples/AWS/Gemfile branches/SESAME_2_7/src/resources/deployment/vagrant/samples/AWS/README.txt branches/SESAME_2_7/src/resources/deployment/vagrant/samples/AWS/Thorfile branches/SESAME_2_7/src/resources/deployment/vagrant/samples/AWS/Vagrantfile.aws.mapgraph branches/SESAME_2_7/src/resources/deployment/vagrant/samples/AWS/Vagrantfile.aws.nss branches/SESAME_2_7/src/resources/deployment/vagrant/samples/AWS/Vagrantfile.aws.nss.build-from-svn branches/SESAME_2_7/src/resources/deployment/vagrant/samples/AWS/Vagrantfile.aws.tomcat branches/SESAME_2_7/src/resources/deployment/vagrant/samples/AWS/Vagrantfile.aws.tomcat.build-from-svn branches/SESAME_2_7/src/resources/deployment/vagrant/samples/AWS/Vagrantfile.dual-provider.tomcat branches/SESAME_2_7/src/resources/deployment/vagrant/samples/AWS/aws.rc branches/SESAME_2_7/src/resources/deployment/vagrant/samples/AWS/chefignore branches/SESAME_2_7/src/resources/deployment/vagrant/samples/AWS/metadata.rb branches/SESAME_2_7/src/resources/deployment/vagrant/samples/VirtualBox/ branches/SESAME_2_7/src/resources/deployment/vagrant/samples/VirtualBox/Berksfile branches/SESAME_2_7/src/resources/deployment/vagrant/samples/VirtualBox/Gemfile branches/SESAME_2_7/src/resources/deployment/vagrant/samples/VirtualBox/README.txt branches/SESAME_2_7/src/resources/deployment/vagrant/samples/VirtualBox/Thorfile branches/SESAME_2_7/src/resources/deployment/vagrant/samples/VirtualBox/Vagrantfile.ha1 branches/SESAME_2_7/src/resources/deployment/vagrant/samples/VirtualBox/Vagrantfile.ha3 branches/SESAME_2_7/src/resources/deployment/vagrant/samples/VirtualBox/Vagrantfile.nss branches/SESAME_2_7/src/resources/deployment/vagrant/samples/VirtualBox/Vagrantfile.nss.build-from-svn branches/SESAME_2_7/src/resources/deployment/vagrant/samples/VirtualBox/Vagrantfile.tomcat branches/SESAME_2_7/src/resources/deployment/vagrant/samples/VirtualBox/Vagrantfile.tomcat.build-from-svn branches/SESAME_2_7/src/resources/deployment/vagrant/samples/VirtualBox/chefignore branches/SESAME_2_7/src/resources/deployment/vagrant/samples/VirtualBox/metadata.rb Modified: branches/SESAME_2_7/bigdata/src/java/com/bigdata/Banner.java =================================================================== --- branches/SESAME_2_7/bigdata/src/java/com/bigdata/Banner.java 2014-07-17 14:10:21 UTC (rev 8566) +++ branches/SESAME_2_7/bigdata/src/java/com/bigdata/Banner.java 2014-07-17 14:57:42 UTC (rev 8567) @@ -55,7 +55,6 @@ * the copyright banner is always written out on bigdata startup. * * @author <a href="mailto:tho...@us...">Bryan Thompson</a> - * @version $Id$ */ public class Banner { @@ -70,7 +69,6 @@ * Environment variables understood by the {@link Banner} class. * * @author <a href="mailto:tho...@us...">Bryan Thompson</a> - * @version $Id$ */ public interface Options { @@ -249,23 +247,52 @@ } /** - * Use reflection to discover and report on the bigdata build information. A - * <code>com.bigdata.BuildInfo</code> is built when the JAR is created. - * However, it may not be present when running under an IDE from the source - * code and, therefore, there MUST NOT be any compile time references to the - * <code>com.bigdata.BuildInfo</code> class. This method uses reflection to - * avoid a compile time dependency. + * An interface which declares the keys for the map returned by + * {@link Banner#getBuildInfo()} . + * + * @author <a href="mailto:tho...@us...">Bryan + * Thompson</a> + */ + public interface BuildInfoMeta { + /** The bigdata release version. */ + String buildVersion = "buildVersion"; + /** The source code revision. */ + String svnRevision = "svnRevision"; + /** The source code repository URL for the branch. */ + String svnURL = "svnURL"; + /** The timestamp of the build. */ + String buildTimestamp = "buildTimestamp"; + /** The username that performed the build. */ + String buildUser = "buildUser"; + /** The hostname on which the build was performed. */ + String buildHost = "buildHost"; + /** The OS architecture on which the build was performed. */ + String osArch = "osArch"; + /** The OS name on which the build was performed. */ + String osName = "osName"; + /** The OS version on which the build was performed. */ + String osVersion = "osVersion"; + } + + /** + * Method used to discover and report on the bigdata build information. A + * <code>com.bigdata.BuildInfo</code> class is built when the JAR is + * created. However, it may not be present when running under an IDE from + * the source code and, therefore, there MUST NOT be any compile time + * references to the <code>com.bigdata.BuildInfo</code> class. This method + * uses reflection to avoid a compile time dependency. * <p> - * Note: This method works fine. However, the problem with exposing the - * information is that people running from an IDE can observe <em>stale</em> - * data from old <code>com.bigdata.BuildInfo</code> class files left from a - * previous build of a JAR. This makes the information good for deployed - * versions of the JAR but potentially misleading when people are running - * under an IDE. + * Note: This method works fine. However, people running from an IDE will + * observe <em>stale</em> data from old <code>com.bigdata.BuildInfo</code> + * class files left from a previous build of a JAR. This makes the + * information good for deployed versions of the JAR but potentially + * misleading when people are running under an IDE. * * @return Build info metadata iff available. + * + * @see BuildInfoMeta */ - private synchronized static Map<String,String> getBuildInfo() { + public synchronized static Map<String,String> getBuildInfo() { if (buildInfoRef.get() == null) { @@ -341,7 +368,7 @@ final StringBuilder s = new StringBuilder(); - s.append("\nbuildVersion=" + getBuildInfo().get("buildVersion")); + s.append("\nbuildVersion=" + getBuildInfo().get(BuildInfoMeta.buildVersion)); // s.append("\nsvnRevision =" + getBuildInfo().get("svnRevision")); @@ -349,6 +376,28 @@ } + /** + * Attempts to return the build version (aka the release version) from the + * <code>com.bigdata.BuildInfo</code> class. This class is generated by + * <code>build.xml</code> and is NOT available from the IDE. It is correct + * discovered using reflection. + * + * @return Build version if available and <code>null</code> otherwise. + * + * @see #getBuildInfo() + */ + public final static String getVersion() { + + if (getBuildInfo().isEmpty()) { + + return null; + + } + + return getBuildInfo().get(BuildInfoMeta.buildVersion); + + } + /** * Outputs the banner and exits. * Modified: branches/SESAME_2_7/bigdata/src/java/com/bigdata/BigdataStatics.java =================================================================== --- branches/SESAME_2_7/bigdata/src/java/com/bigdata/BigdataStatics.java 2014-07-17 14:10:21 UTC (rev 8566) +++ branches/SESAME_2_7/bigdata/src/java/com/bigdata/BigdataStatics.java 2014-07-17 14:57:42 UTC (rev 8567) @@ -27,12 +27,14 @@ package com.bigdata; +import com.bigdata.journal.IIndexManager; +import com.bigdata.relation.AbstractRelation; + /** * A class for those few statics that it makes sense to reference from other * places. * * @author <a href="mailto:tho...@us...">Bryan Thompson</a> - * @version $Id$ */ public class BigdataStatics { @@ -109,4 +111,20 @@ } + /** + * FIXME GROUP COMMIT : Disable/Enable group commit on the Journal from the + * NSS API. Some global flag should control this and also disable the + * journal's semaphore and should disable the wrapping of BTree as an + * UnisolatedReadWriteIndex ( + * {@link AbstractRelation#getIndex(IIndexManager, String, long)}, and + * should disable the calls to commit() or abort() from the LocalTripleStore + * to the Journal. + * + * @see <a href="http://sourceforge.net/apps/trac/bigdata/ticket/753" > HA + * doLocalAbort() should interrupt NSS requests and AbstractTasks </a> + * @see <a href="- http://sourceforge.net/apps/trac/bigdata/ticket/566" > + * Concurrent unisolated operations against multiple KBs </a> + */ + public static final boolean NSS_GROUP_COMMIT = Boolean.getBoolean("com.bigdata.nssGroupCommit"); + } Modified: branches/SESAME_2_7/bigdata/src/java/com/bigdata/bop/controller/SubqueryJoinAnnotations.java =================================================================== --- branches/SESAME_2_7/bigdata/src/java/com/bigdata/bop/controller/SubqueryJoinAnnotations.java 2014-07-17 14:10:21 UTC (rev 8566) +++ branches/SESAME_2_7/bigdata/src/java/com/bigdata/bop/controller/SubqueryJoinAnnotations.java 2014-07-17 14:57:42 UTC (rev 8567) @@ -33,11 +33,6 @@ * Annotations for joins against a subquery. * * @author <a href="mailto:tho...@us...">Bryan Thompson</a> - * @version $Id: SubqueryJoinAnnotations.java 5491 2011-11-02 20:11:07Z - * thompsonbry $ - * - * @deprecated With {@link SubqueryOp}, which is the sole class which extends - * this interface. */ public interface SubqueryJoinAnnotations extends JoinAnnotations, SubqueryAnnotations { Modified: branches/SESAME_2_7/bigdata/src/java/com/bigdata/bop/controller/SubqueryOp.java =================================================================== --- branches/SESAME_2_7/bigdata/src/java/com/bigdata/bop/controller/SubqueryOp.java 2014-07-17 14:10:21 UTC (rev 8566) +++ branches/SESAME_2_7/bigdata/src/java/com/bigdata/bop/controller/SubqueryOp.java 2014-07-17 14:57:42 UTC (rev 8567) @@ -92,20 +92,28 @@ * evaluation semantics under these conditions. This is handled by "projecting" * only those variables into the subquery which it will project out. * + * <h3>Efficiency</h3> + * + * This non-vectored operator issues one sub-query per source solution flowing + * into the operator. In general, it is MUCH more efficient to vector the + * solutions into a sub-plan. The latter is accomplished by building a hash + * index over the source solutions, flooding them into the sub-plan, and then + * executing the appropriate hash join back against the source solutions after + * the sub-plan. + * <p> + * There are a few cases where it may make sense to use the non-vectored + * operator. For example, for EXISTS where LIMIT ONE can be imposed on the + * subquery. However, there can still be cases where the vectored sub-plan is + * more efficient. + * * @see AbstractSubqueryOp * @see JVMNamedSubqueryOp * @see HTreeNamedSubqueryOp * * @author <a href="mailto:tho...@us...">Bryan Thompson</a> * - * @deprecated This operator is no longer in use. The last use case which we had - * for this was in support of ASK subquery evaluation for (NOT) - * EXISTS. - * <p> - * It is possible that another use case MIGHT be found to support - * parallel evaluation of named subqueries. However, that also might - * be handled by a thread pool if we move to interleaved query plan - * generation and query plan evaluation in support of the RTO. + * @see <a href="http://trac.bigdata.com/ticket/988"> bad performance for FILTER + * EXISTS </a> */ public class SubqueryOp extends PipelineOp { @@ -222,6 +230,7 @@ } + @Override public FutureTask<Void> eval(final BOpContext<IBindingSet> context) { return new FutureTask<Void>(new ControllerTask(this, context)); @@ -287,6 +296,7 @@ /** * Evaluate the subquery. */ + @Override public Void call() throws Exception { try { Modified: branches/SESAME_2_7/bigdata/src/java/com/bigdata/bop/engine/AbstractRunningQuery.java =================================================================== --- branches/SESAME_2_7/bigdata/src/java/com/bigdata/bop/engine/AbstractRunningQuery.java 2014-07-17 14:10:21 UTC (rev 8566) +++ branches/SESAME_2_7/bigdata/src/java/com/bigdata/bop/engine/AbstractRunningQuery.java 2014-07-17 14:57:42 UTC (rev 8567) @@ -99,7 +99,6 @@ * first result when compared with pipelined evaluation. * * @author <a href="mailto:tho...@us...">Bryan Thompson</a> - * @version $Id$ */ abstract public class AbstractRunningQuery implements IRunningQuery { @@ -146,13 +145,13 @@ /** The unique identifier for this query. */ final private UUID queryId; - /** - * The query deadline. The value is the system clock time in milliseconds - * when the query is due and {@link Long#MAX_VALUE} if there is no deadline. - * In order to have a guarantee of a consistent clock, the deadline is - * interpreted by the query controller. - */ - final private AtomicLong deadline = new AtomicLong(Long.MAX_VALUE); +// /** +// * The query deadline. The value is the system clock time in milliseconds +// * when the query is due and {@link Long#MAX_VALUE} if there is no deadline. +// * In order to have a guarantee of a consistent clock, the deadline is +// * interpreted by the query controller. +// */ +// final private AtomicLong deadline = new AtomicLong(Long.MAX_VALUE); /** * The timestamp (ms) when the query begins to execute. @@ -1744,7 +1743,7 @@ lock.lock(); try { sb.append(",elapsed=" + getElapsed()); - sb.append(",deadline=" + deadline.get()); + sb.append(",deadline=" + runState.getDeadline()); sb.append(",isDone=" + isDone()); sb.append(",isCancelled=" + isCancelled()); sb.append(",runState=" + runState); Modified: branches/SESAME_2_7/bigdata/src/java/com/bigdata/bop/engine/IRunningQuery.java =================================================================== --- branches/SESAME_2_7/bigdata/src/java/com/bigdata/bop/engine/IRunningQuery.java 2014-07-17 14:10:21 UTC (rev 8566) +++ branches/SESAME_2_7/bigdata/src/java/com/bigdata/bop/engine/IRunningQuery.java 2014-07-17 14:57:42 UTC (rev 8567) @@ -114,8 +114,8 @@ Map<Integer/* bopId */, BOpStats> getStats(); /** - * Return the query deadline (the time at which it will terminate regardless - * of its run state). + * Return the query deadline in milliseconds (the time at which it will + * terminate regardless of its run state). * * @return The query deadline (milliseconds since the epoch) and * {@link Long#MAX_VALUE} if no explicit deadline was specified. Modified: branches/SESAME_2_7/bigdata/src/java/com/bigdata/bop/engine/QueryDeadline.java =================================================================== --- branches/SESAME_2_7/bigdata/src/java/com/bigdata/bop/engine/QueryDeadline.java 2014-07-17 14:10:21 UTC (rev 8566) +++ branches/SESAME_2_7/bigdata/src/java/com/bigdata/bop/engine/QueryDeadline.java 2014-07-17 14:57:42 UTC (rev 8567) @@ -19,9 +19,9 @@ class QueryDeadline implements Comparable<QueryDeadline> { /** - * The deadline for this query. + * The deadline for this query (in nanoseconds). */ - final long deadline; + final long deadlineNanos; /** * A reference to the query. @@ -33,14 +33,14 @@ /** * - * @param deadline - * The deadline. + * @param deadlineNanos + * The deadline for this query (in nanoseconds). * @param query * The query. */ - public QueryDeadline(final long deadline, final AbstractRunningQuery query) { + public QueryDeadline(final long deadlineNanos, final AbstractRunningQuery query) { - this.deadline = deadline; + this.deadlineNanos = deadlineNanos; this.queryRef = new WeakReference<AbstractRunningQuery>(query); @@ -61,8 +61,8 @@ */ @Override public int compareTo(final QueryDeadline o) { - final long d0 = this.deadline; - final long d1 = o.deadline; + final long d0 = this.deadlineNanos; + final long d1 = o.deadlineNanos; if (d0 < d1) return -1; if (d0 > d1) @@ -74,13 +74,13 @@ * Check the deadline on the query. If the query is not terminated and the * deadline has expired, then the query is terminated as a side-effect. * - * @param now + * @param nowNanosIsIgnored * A current timestamp. * * @return <code>null</code> if the query is terminated and * <code>this</code> if the query is not terminated. */ - QueryDeadline checkDeadline(final long now) { + QueryDeadline checkDeadline(final long nowNanosIsIgnored) { final AbstractRunningQuery q = queryRef.get(); Modified: branches/SESAME_2_7/bigdata/src/java/com/bigdata/bop/engine/QueryEngine.java =================================================================== --- branches/SESAME_2_7/bigdata/src/java/com/bigdata/bop/engine/QueryEngine.java 2014-07-17 14:10:21 UTC (rev 8566) +++ branches/SESAME_2_7/bigdata/src/java/com/bigdata/bop/engine/QueryEngine.java 2014-07-17 14:57:42 UTC (rev 8567) @@ -195,7 +195,6 @@ * query manager task for the terminated join. * * @author <a href="mailto:tho...@us...">Bryan Thompson</a> - * @version $Id$ * * @todo Expander patterns will continue to exist until we handle the standalone * backchainers in a different manner for scale-out so add support for @@ -669,15 +668,17 @@ throw new IllegalArgumentException(); } - deadlineQueue.add(new QueryDeadline(deadline, query)); + final long deadlineNanos = TimeUnit.MILLISECONDS.toNanos(deadline); + deadlineQueue.add(new QueryDeadline(deadlineNanos, query)); + } /** * Scan the priority queue of queries with a specified deadline, halting any * queries whose deadline has expired. */ - static private void checkDeadlines(final long now, + static private void checkDeadlines(final long nowNanos, final PriorityBlockingQueue<QueryDeadline> deadlineQueue) { /* @@ -690,7 +691,7 @@ * Check the head of the deadline queue for any queries whose * deadline has expired. */ - checkHeadOfDeadlineQueue(now, deadlineQueue); + checkHeadOfDeadlineQueue(nowNanos, deadlineQueue); if (deadlineQueue.size() > DEADLINE_QUEUE_SCAN_SIZE) { @@ -698,7 +699,7 @@ * Scan the deadline queue, removing entries for expired * queries. */ - scanDeadlineQueue(now, deadlineQueue); + scanDeadlineQueue(nowNanos, deadlineQueue); } @@ -710,7 +711,7 @@ * Check the head of the deadline queue for any queries whose deadline has * expired. */ - static private void checkHeadOfDeadlineQueue(final long now, + static private void checkHeadOfDeadlineQueue(final long nowNanos, final PriorityBlockingQueue<QueryDeadline> deadlineQueue) { QueryDeadline x; @@ -719,7 +720,7 @@ while ((x = deadlineQueue.poll()) != null) { // test for query done or deadline expired. - if (x.checkDeadline(now) == null) { + if (x.checkDeadline(nowNanos) == null) { /* * This query is known to be done. It was removed from the @@ -731,7 +732,7 @@ } - if (x.deadline > now) { + if (x.deadlineNanos > nowNanos) { /* * This query has not yet reached its deadline. That means that @@ -757,7 +758,7 @@ * has not be reached. Therefore, periodically, we need to scan the queue * and clear out entries for terminated queries. */ - static private void scanDeadlineQueue(final long now, + static private void scanDeadlineQueue(final long nowNanos, final PriorityBlockingQueue<QueryDeadline> deadlineQueue) { final List<QueryDeadline> c = new ArrayList<QueryDeadline>( @@ -770,7 +771,7 @@ for (QueryDeadline x : c) { - if (x.checkDeadline(now) != null) { + if (x.checkDeadline(nowNanos) != null) { // return this query to the deadline queue. deadlineQueue.add(x); @@ -939,27 +940,31 @@ if(log.isInfoEnabled()) log.info("Running: " + this); try { - long mark = System.currentTimeMillis(); - long remaining = DEADLINE_CHECK_MILLIS; + final long deadline = TimeUnit.MILLISECONDS + .toNanos(DEADLINE_CHECK_MILLIS); + long mark = System.nanoTime(); + long remaining = deadline; while (true) { try { + //log.warn("Polling deadline queue: remaining="+remaining+", deadlinkCheckMillis="+DEADLINE_CHECK_MILLIS); final AbstractRunningQuery q = priorityQueue.poll( - remaining, TimeUnit.MILLISECONDS); - final long now = System.currentTimeMillis(); - if ((remaining = now - mark) < 0) { + remaining, TimeUnit.NANOSECONDS); + final long now = System.nanoTime(); + if ((remaining = deadline - (now - mark)) < 0) { + //log.error("Checking deadline queue"); /* * Check for queries whose deadline is expired. - * + * * Note: We only do this every DEADLINE_CHECK_MILLIS * and then reset [mark] and [remaining]. - * + * * Note: In queue.pool(), we only wait only up to * the [remaining] time before the next check in * queue.poll(). */ checkDeadlines(now, deadlineQueue); mark = now; - remaining = DEADLINE_CHECK_MILLIS; + remaining = deadline; } // Consume chunk already on queue for this query. if (q != null && !q.isDone()) Modified: branches/SESAME_2_7/bigdata/src/java/com/bigdata/bop/engine/QueryLog.java =================================================================== --- branches/SESAME_2_7/bigdata/src/java/com/bigdata/bop/engine/QueryLog.java 2014-07-17 14:10:21 UTC (rev 8566) +++ branches/SESAME_2_7/bigdata/src/java/com/bigdata/bop/engine/QueryLog.java 2014-07-17 14:57:42 UTC (rev 8567) @@ -64,7 +64,6 @@ import com.bigdata.bop.solutions.SliceOp; import com.bigdata.btree.Tuple; import com.bigdata.counters.render.XHTMLRenderer; -import com.bigdata.rawstore.Bytes; import com.bigdata.rdf.sparql.ast.eval.AST2BOpJoins; import com.bigdata.striterator.IKeyOrder; @@ -73,7 +72,6 @@ * written. * * @author <a href="mailto:tho...@us...">Bryan Thompson</a> - * @version $Id: RuleLog.java 3448 2010-08-18 20:55:58Z thompsonbry $ */ public class QueryLog { @@ -101,75 +99,84 @@ log.info(QueryLog.getTableHeader()); } - /** - * A single buffer is reused to keep down the heap churn. - */ - final private static StringBuilder sb = new StringBuilder( - Bytes.kilobyte32 * 4); +// /** +// * A single buffer is reused to keep down the heap churn. +// */ +// final private static StringBuilder sb = new StringBuilder( +// Bytes.kilobyte32 * 4); /** - * Log rule execution statistics. + * Log rule execution statistics @ INFO. * * @param q * The running query. */ static public void log(final IRunningQuery q) { - if (log.isInfoEnabled()) { + if (!log.isInfoEnabled()) + return; - try { + try { - final IRunningQuery[] children = (q instanceof AbstractRunningQuery) ? ((AbstractRunningQuery) q) - .getChildren() : null; + final IRunningQuery[] children = (q instanceof AbstractRunningQuery) ? ((AbstractRunningQuery) q) + .getChildren() : null; - /* - * Note: We could use a striped lock here over a small pool of - * StringBuilder's to decrease contention for the single buffer - * while still avoiding heap churn for buffer allocation. Do - * this if the monitor for this StringBuilder shows up as a hot - * spot when query logging is enabled. - */ - synchronized (sb) { + /** + * Note: The static StringBuilder can not be used if the parent + * query has child subqueries without running into a deadlock on + * the [sb] object. If there are no children, we could reuse the + * global static [sb] and the AbstractRunningQuery.lock(). + * However, log(IRunningQuery) is ONLY invoke by + * AbstractRunningQuery.cancel() and then only runs IFF QueryLog + * is @ INFO. Since this is a rare combination, allocating a new + * StringBuilder object here will not have an adverse impact on + * the heap and avoids the possibility of a deadlock. + * + * @see <a href="http://trac.bigdata.com/ticket/992" > Deadlock + * between AbstractRunningQuery.cancel(), QueryLog.log(), + * and ArbitraryLengthPathTask</a> + */ + final StringBuilder sb = new StringBuilder(); +// synchronized (sb) + { - // clear the buffer. - sb.setLength(0); + // clear the buffer. + sb.setLength(0); - { - final Map<Integer/* bopId */, QueueStats> queueStats = ((ChunkedRunningQuery) q) - .getQueueStats(); + { + final Map<Integer/* bopId */, QueueStats> queueStats = ((ChunkedRunningQuery) q) + .getQueueStats(); - logSummaryRow(q, queueStats, sb); + logSummaryRow(q, queueStats, sb); - logDetailRows(q, queueStats, sb); - } + logDetailRows(q, queueStats, sb); + } - if (children != null) { + if (children != null) { - for (int i = 0; i < children.length; i++) { + for (int i = 0; i < children.length; i++) { - final IRunningQuery c = children[i]; - - final Map<Integer/* bopId */, QueueStats> queueStats = ((ChunkedRunningQuery) c) - .getQueueStats(); - - logSummaryRow(c, queueStats, sb); - - logDetailRows(c, queueStats, sb); + final IRunningQuery c = children[i]; + + final Map<Integer/* bopId */, QueueStats> queueStats = ((ChunkedRunningQuery) c) + .getQueueStats(); + + logSummaryRow(c, queueStats, sb); + + logDetailRows(c, queueStats, sb); - } - } + + } - log.info(sb); + log.info(sb); - } - - } catch (RuntimeException t) { - - log.error(t,t); - } + + } catch (RuntimeException t) { + log.error(t,t); + } } Modified: branches/SESAME_2_7/bigdata/src/java/com/bigdata/bop/paths/ArbitraryLengthPathOp.java =================================================================== --- branches/SESAME_2_7/bigdata/src/java/com/bigdata/bop/paths/ArbitraryLengthPathOp.java 2014-07-17 14:10:21 UTC (rev 8566) +++ branches/SESAME_2_7/bigdata/src/java/com/bigdata/bop/paths/ArbitraryLengthPathOp.java 2014-07-17 14:57:42 UTC (rev 8567) @@ -52,6 +52,7 @@ import com.bigdata.bop.engine.AbstractRunningQuery; import com.bigdata.bop.engine.IRunningQuery; import com.bigdata.bop.engine.QueryEngine; +import com.bigdata.bop.join.JVMDistinctFilter; import cutthecrap.utils.striterators.ICloseableIterator; @@ -83,6 +84,10 @@ * solutions from the subquery with those in the parent context. * * @author <a href="mailto:mpe...@us...">Mike Personick</a> + * + * TODO There should be two version of this operator. One for the JVM + * heap and another for the native heap. This will help when large + * amounts of data are materialized by the internal collections. */ public class ArbitraryLengthPathOp extends PipelineOp { @@ -187,6 +192,7 @@ } + @Override public FutureTask<Void> eval(final BOpContext<IBindingSet> context) { return new FutureTask<Void>(new ArbitraryLengthPathTask(this, context)); @@ -251,6 +257,7 @@ } + @Override public Void call() throws Exception { ... [truncated message content] |
From: <mrp...@us...> - 2014-07-17 14:10:27
|
Revision: 8566 http://sourceforge.net/p/bigdata/code/8566 Author: mrpersonick Date: 2014-07-17 14:10:21 +0000 (Thu, 17 Jul 2014) Log Message: ----------- trying to get the tests to compile and run in ant Modified Paths: -------------- branches/SESAME_2_7/bigdata-sails/src/test/org/openrdf/query/parser/sparql/SPARQLUpdateTest.java branches/SESAME_2_7/bigdata-sails/src/test/org/openrdf/repository/RepositoryConnectionTest.java branches/SESAME_2_7/build.xml Modified: branches/SESAME_2_7/bigdata-sails/src/test/org/openrdf/query/parser/sparql/SPARQLUpdateTest.java =================================================================== --- branches/SESAME_2_7/bigdata-sails/src/test/org/openrdf/query/parser/sparql/SPARQLUpdateTest.java 2014-07-17 13:01:23 UTC (rev 8565) +++ branches/SESAME_2_7/bigdata-sails/src/test/org/openrdf/query/parser/sparql/SPARQLUpdateTest.java 2014-07-17 14:10:21 UTC (rev 8566) @@ -19,24 +19,14 @@ */ package org.openrdf.query.parser.sparql; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; - import java.io.IOException; import java.io.InputStream; import junit.framework.TestCase; -import junit.framework.TestCase2; import org.junit.After; import org.junit.Before; import org.junit.Test; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - import org.openrdf.model.BNode; import org.openrdf.model.Literal; import org.openrdf.model.Resource; @@ -60,6 +50,8 @@ import org.openrdf.repository.RepositoryResult; import org.openrdf.rio.RDFFormat; import org.openrdf.rio.RDFParseException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import com.bigdata.rdf.store.BD; Modified: branches/SESAME_2_7/bigdata-sails/src/test/org/openrdf/repository/RepositoryConnectionTest.java =================================================================== --- branches/SESAME_2_7/bigdata-sails/src/test/org/openrdf/repository/RepositoryConnectionTest.java 2014-07-17 13:01:23 UTC (rev 8565) +++ branches/SESAME_2_7/bigdata-sails/src/test/org/openrdf/repository/RepositoryConnectionTest.java 2014-07-17 14:10:21 UTC (rev 8566) @@ -198,8 +198,6 @@ protected Literal mboxBob; - protected Literal Александър; - public RepositoryConnectionTest(String name) { super(name); } @@ -233,8 +231,6 @@ mboxAlice = vf.createLiteral("al...@ex..."); mboxBob = vf.createLiteral("bo...@ex..."); - Александър = vf.createLiteral("Александър"); - unknownContext = new URIImpl("urn:unknownContext"); context1 = vf.createURI("urn:x-local:graph1"); @@ -598,44 +594,6 @@ } } -// @Test -// public void testPrepareSeRQLQuery() -// throws Exception -// { -// -// StringBuilder queryBuilder = new StringBuilder(); -// queryBuilder.append(" SELECT ?person"); -// queryBuilder.append(" FROM {person} foaf:name {").append(Александър.getLabel()).append("}"); -// queryBuilder.append(" USING NAMESPACE foaf = <" + FOAF_NS + ">"); -// -// try { -// testCon.prepareQuery(QueryLanguage.SERQL, queryBuilder.toString()); -// } -// catch (UnsupportedOperationException e) { -// fail(UNSUPPORTED_OP + e.getMessage()); -// } -// catch (ClassCastException e) { -// fail(UNEXPECTED_TYPE + e.getMessage()); -// } -// -// queryBuilder = new StringBuilder(); -// queryBuilder.append(" (SELECT person"); -// queryBuilder.append(" FROM {person} foaf:name {").append(Александър.getLabel()).append("}"); -// queryBuilder.append(") UNION "); -// queryBuilder.append("(SELECT x FROM {x} p {y} )"); -// queryBuilder.append(" USING NAMESPACE foaf = <" + FOAF_NS + ">"); -// -// try { -// testCon.prepareQuery(QueryLanguage.SERQL, queryBuilder.toString()); -// } -// catch (UnsupportedOperationException e) { -// fail(UNSUPPORTED_OP + e.getMessage()); -// } -// catch (ClassCastException e) { -// fail(UNEXPECTED_TYPE + e.getMessage()); -// } -// } - @Test public void testPrepareSPARQLQuery() throws Exception @@ -676,30 +634,6 @@ } @Test - public void testSimpleTupleQueryUnicode() - throws Exception - { - testCon.add(alexander, name, Александър); - StringBuilder queryBuilder = new StringBuilder(128); - queryBuilder.append(" prefix foaf: <" + FOAF_NS + ">"); - queryBuilder.append(" SELECT ?person"); - queryBuilder.append(" where { ?person foaf:name \"").append(Александър.getLabel()).append("\"}"); - TupleQueryResult result = testCon.prepareTupleQuery(QueryLanguage.SPARQL, queryBuilder.toString()).evaluate(); - try { - assertThat(result, is(notNullValue())); - assertThat(result.hasNext(), is(equalTo(true))); - while (result.hasNext()) { - BindingSet solution = result.next(); - assertThat(solution.hasBinding(PERSON), is(equalTo(true))); - assertThat(solution.getValue(PERSON), is(equalTo((Value)alexander))); - } - } - finally { - result.close(); - } - } - - @Test public void testPreparedTupleQuery() throws Exception { @@ -770,37 +704,6 @@ } @Test - public void testPreparedTupleQueryUnicode() - throws Exception - { - testCon.add(alexander, name, Александър); - - StringBuilder queryBuilder = new StringBuilder(); - queryBuilder.append(" prefix foaf: <" + FOAF_NS + ">"); - queryBuilder.append(" SELECT ?person"); - queryBuilder.append(" where { ?person foaf:name ?name }"); - - TupleQuery query = testCon.prepareTupleQuery(QueryLanguage.SPARQL, queryBuilder.toString()); - query.setBinding(NAME, Александър); - - TupleQueryResult result = query.evaluate(); - - try { - assertThat(result, is(notNullValue())); - assertThat(result.hasNext(), is(equalTo(true))); - - while (result.hasNext()) { - BindingSet solution = result.next(); - assertThat(solution.hasBinding(PERSON), is(equalTo(true))); - assertThat(solution.getValue(PERSON), is(equalTo((Value)alexander))); - } - } - finally { - result.close(); - } - } - - @Test public void testSimpleGraphQuery() throws Exception { Modified: branches/SESAME_2_7/build.xml =================================================================== --- branches/SESAME_2_7/build.xml 2014-07-17 13:01:23 UTC (rev 8565) +++ branches/SESAME_2_7/build.xml 2014-07-17 14:10:21 UTC (rev 8566) @@ -1792,7 +1792,8 @@ <!-- is available, change the corresponding property value set --> <!-- below. --> - <property name="junit.jar" location="${bigdata.lib}/junit-3.8.1.jar" /> + <property name="junit.jar" location="${bigdata.lib}/junit-4.11.jar" /> + <property name="hamcrest.jar" location="${bigdata.lib}/hamcrest-core-1.3.jar" /> <property name="junit-ext.jar" location="${bigdata.lib}/junit-ext-1.1-b3-dev.jar" /> <property name="sesame-sparql-test.jar" location="${bigdata-sails.lib}/sesame-sparql-testsuite-${sesame.version}.jar" /> <property name="sesame-store-test.jar" location="${bigdata-sails.lib}/sesame-store-testsuite-${sesame.version}.jar" /> @@ -1809,7 +1810,7 @@ <!-- TODO ${path.separator}${dist.lib}/bigdata-gas.jar --> <property name="javac.test.classpath" - value="${classes.dir}${path.separator}${junit.jar}${path.separator}${junit-ext.jar}${path.separator}${sesame-sparql-test.jar}${path.separator}${sesame-store-test.jar}${path.separator}${sesame-rio-test.jar}${path.separator}${dist.lib}/classserver.jar${path.separator}${dist.lib}/highscalelib.jar${path.separator}${dist.lib}/dsiutils.jar${path.separator}${dist.lib}/lgplutils.jar${path.separator}${dist.lib}/fastutil.jar${path.separator}${dist.lib}/bigdata-ganglia.jar${path.separator}${dist.lib}/icu4j.jar${path.separator}${dist.lib}/icu4j-charset.jar${path.separator}${dist.lib}/log4j.jar${path.separator}${dist.lib}/lucene-analyzer.jar${path.separator}${dist.lib}/lucene-core.jar${path.separator}${path.separator}${dist.lib}/openrdf-sesame.jar${path.separator}${dist.lib}/slf4j.jar${path.separator}${dist.lib}/jsk-lib.jar${path.separator}${dist.lib}/jsk-platform.jar${path.separator}${dist.lib}/nxparser.jar${path.separator}${dist.lib}/zookeeper.jar${path.separator}${dist.lib}/jetty-continuation.jar${path.separator}${dist.lib}/jetty-http.jar${path.separator}${dist.lib}/jetty-io.jar${path.separator}${dist.lib}/jetty-jmx.jar${path.separator}${dist.lib}/jetty-jndi.jar${path.separator}${dist.lib}/jetty-server.jar${path.separator}${dist.lib}/jetty-util.jar${path.separator}${dist.lib}/jetty-webapp.jar${path.separator}${dist.lib}/jetty-servlet.jar${path.separator}${dist.lib}/jetty-security.jar${path.separator}${dist.lib}/jetty-xml.jar${path.separator}${dist.lib}/jetty-rewrite.jar${path.separator}${dist.lib}/jetty-client.jar${path.separator}${dist.lib}/jetty-proxy.jar${path.separator}${dist.lib}/servlet-api.jar${path.separator}${dist.lib}/commons-codec.jar${path.separator}${dist.lib}/commons-fileupload.jar${path.separator}${dist.lib}/commons-io.jar${path.separator}${dist.lib}/commons-logging.jar${path.separator}${dist.lib}/httpclient.jar${path.separator}${dist.lib}/httpclient-cache.jar${path.separator}${dist.lib}/httpcore.jar${path.separator}${dist.lib}/httpmime.jar${path.separator}${dist.lib}/blueprints-core.jar${path.separator}${blueprints-test.jar}${path.separator}${jettison.jar}" /> + value="${classes.dir}${path.separator}${junit.jar}${path.separator}${hamcrest.jar}${path.separator}${junit-ext.jar}${path.separator}${sesame-sparql-test.jar}${path.separator}${sesame-store-test.jar}${path.separator}${sesame-rio-test.jar}${path.separator}${dist.lib}/classserver.jar${path.separator}${dist.lib}/highscalelib.jar${path.separator}${dist.lib}/dsiutils.jar${path.separator}${dist.lib}/lgplutils.jar${path.separator}${dist.lib}/fastutil.jar${path.separator}${dist.lib}/bigdata-ganglia.jar${path.separator}${dist.lib}/icu4j.jar${path.separator}${dist.lib}/icu4j-charset.jar${path.separator}${dist.lib}/log4j.jar${path.separator}${dist.lib}/lucene-analyzer.jar${path.separator}${dist.lib}/lucene-core.jar${path.separator}${path.separator}${dist.lib}/openrdf-sesame.jar${path.separator}${dist.lib}/slf4j.jar${path.separator}${dist.lib}/jsk-lib.jar${path.separator}${dist.lib}/jsk-platform.jar${path.separator}${dist.lib}/nxparser.jar${path.separator}${dist.lib}/zookeeper.jar${path.separator}${dist.lib}/jetty-continuation.jar${path.separator}${dist.lib}/jetty-http.jar${path.separator}${dist.lib}/jetty-io.jar${path.separator}${dist.lib}/jetty-jmx.jar${path.separator}${dist.lib}/jetty-jndi.jar${path.separator}${dist.lib}/jetty-server.jar${path.separator}${dist.lib}/jetty-util.jar${path.separator}${dist.lib}/jetty-webapp.jar${path.separator}${dist.lib}/jetty-servlet.jar${path.separator}${dist.lib}/jetty-security.jar${path.separator}${dist.lib}/jetty-xml.jar${path.separator}${dist.lib}/jetty-rewrite.jar${path.separator}${dist.lib}/jetty-client.jar${path.separator}${dist.lib}/jetty-proxy.jar${path.separator}${dist.lib}/servlet-api.jar${path.separator}${dist.lib}/commons-codec.jar${path.separator}${dist.lib}/commons-fileupload.jar${path.separator}${dist.lib}/commons-io.jar${path.separator}${dist.lib}/commons-logging.jar${path.separator}${dist.lib}/httpclient.jar${path.separator}${dist.lib}/httpclient-cache.jar${path.separator}${dist.lib}/httpcore.jar${path.separator}${dist.lib}/httpmime.jar${path.separator}${dist.lib}/blueprints-core.jar${path.separator}${blueprints-test.jar}${path.separator}${jettison.jar}" /> <echo>javac </echo> @@ -2145,6 +2146,7 @@ <path id="run.class.path.id"> <pathelement location="${junit.jar}" /> + <pathelement location="${hamcrest.jar}" /> <pathelement location="${bigdata-test.jar}" /> <pathelement location="${junit-ext.jar}" /> <pathelement location="${sesame-sparql-test.jar}" /> @@ -2202,7 +2204,7 @@ </path> <property name="run.class.path" - value="${junit.jar}${path.separator}${bigdata-test.jar}${path.separator}${junit-ext.jar}${path.separator}${sesame-sparql-test.jar}${path.separator}${sesame-store-test.jar}${path.separator}${sesame-rio-test.jar}${path.separator}${dist.lib}/bigdata.jar${path.separator}${dist.lib}/colt.jar${path.separator}${dist.lib}/highscalelib.jar${path.separator}${dist.lib}/dsiutils.jar${path.separator}${dist.lib}/lgplutils.jar${path.separator}${dist.lib}/fastutil.jar${path.separator}${dist.lib}/bigdata-ganglia.jar${path.separator}${dist.lib}/bigdata-gas${path.separator}${dist.lib}/icu4j.jar${path.separator}${dist.lib}/icu4j-charset.jar${path.separator}${dist.lib}/jsk-lib.jar${path.separator}${dist.lib}/jsk-platform.jar${path.separator}${dist.lib}/log4j.jar${path.separator}${dist.lib}/lucene-analyzer.jar${path.separator}${dist.lib}/lucene-core.jar${path.separator}${dist.lib}/openrdf-sesame.jar${path.separator}${dist.lib}/slf4j.jar${path.separator}${dist.lib}/slf4j-log4j.jar${path.separator}${dist.lib}/nxparser.jar${path.separator}${dist.lib}/zookeeper.jar${path.separator}${dist.lib}/jetty-continuation.jar${path.separator}${dist.lib}/jetty-http.jar${path.separator}${dist.lib}/jetty-io.jar${path.separator}${dist.lib}/jetty-jmx.jar${path.separator}${dist.lib}/jetty-jndi.jar${path.separator}${dist.lib}/jetty-server.jar${path.separator}${dist.lib}/jetty-util.jar${path.separator}${dist.lib}/jetty-webapp.jar${path.separator}${dist.lib}/jetty-servlet.jar${path.separator}${dist.lib}/jetty-security.jar${path.separator}${dist.lib}/jetty-xml.jar${path.separator}${dist.lib}/jetty-rewrite.jar${path.separator}${dist.lib}/jetty-client.jar${path.separator}${dist.lib}/jetty-proxy.jar${path.separator}${dist.lib}/servlet-api.jar${path.separator}${dist.lib}/commons-codec.jar${path.separator}${dist.lib}/commons-fileupload.jar${path.separator}${dist.lib}/commons-io.jar${path.separator}${dist.lib}/commons-logging.jar${path.separator}${dist.lib}/httpclient.jar${path.separator}${dist.lib}/httpclient-cache.jar${path.separator}${dist.lib}/httpcore.jar${path.separator}${dist.lib}/httpmime.jar${path.separator}${dist.lib}/blueprints-core.jar${path.separator}${blueprints-test.jar}${path.separator}${jettison.jar}" /> + value="${junit.jar}${path.separator}${hamcrest.jar}${path.separator}${bigdata-test.jar}${path.separator}${junit-ext.jar}${path.separator}${sesame-sparql-test.jar}${path.separator}${sesame-store-test.jar}${path.separator}${sesame-rio-test.jar}${path.separator}${dist.lib}/bigdata.jar${path.separator}${dist.lib}/colt.jar${path.separator}${dist.lib}/highscalelib.jar${path.separator}${dist.lib}/dsiutils.jar${path.separator}${dist.lib}/lgplutils.jar${path.separator}${dist.lib}/fastutil.jar${path.separator}${dist.lib}/bigdata-ganglia.jar${path.separator}${dist.lib}/bigdata-gas${path.separator}${dist.lib}/icu4j.jar${path.separator}${dist.lib}/icu4j-charset.jar${path.separator}${dist.lib}/jsk-lib.jar${path.separator}${dist.lib}/jsk-platform.jar${path.separator}${dist.lib}/log4j.jar${path.separator}${dist.lib}/lucene-analyzer.jar${path.separator}${dist.lib}/lucene-core.jar${path.separator}${dist.lib}/openrdf-sesame.jar${path.separator}${dist.lib}/slf4j.jar${path.separator}${dist.lib}/slf4j-log4j.jar${path.separator}${dist.lib}/nxparser.jar${path.separator}${dist.lib}/zookeeper.jar${path.separator}${dist.lib}/jetty-continuation.jar${path.separator}${dist.lib}/jetty-http.jar${path.separator}${dist.lib}/jetty-io.jar${path.separator}${dist.lib}/jetty-jmx.jar${path.separator}${dist.lib}/jetty-jndi.jar${path.separator}${dist.lib}/jetty-server.jar${path.separator}${dist.lib}/jetty-util.jar${path.separator}${dist.lib}/jetty-webapp.jar${path.separator}${dist.lib}/jetty-servlet.jar${path.separator}${dist.lib}/jetty-security.jar${path.separator}${dist.lib}/jetty-xml.jar${path.separator}${dist.lib}/jetty-rewrite.jar${path.separator}${dist.lib}/jetty-client.jar${path.separator}${dist.lib}/jetty-proxy.jar${path.separator}${dist.lib}/servlet-api.jar${path.separator}${dist.lib}/commons-codec.jar${path.separator}${dist.lib}/commons-fileupload.jar${path.separator}${dist.lib}/commons-io.jar${path.separator}${dist.lib}/commons-logging.jar${path.separator}${dist.lib}/httpclient.jar${path.separator}${dist.lib}/httpclient-cache.jar${path.separator}${dist.lib}/httpcore.jar${path.separator}${dist.lib}/httpmime.jar${path.separator}${dist.lib}/blueprints-core.jar${path.separator}${blueprints-test.jar}${path.separator}${jettison.jar}" /> <echo> classpath: ${run.class.path} </echo> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tho...@us...> - 2014-07-17 13:01:32
|
Revision: 8565 http://sourceforge.net/p/bigdata/code/8565 Author: thompsonbry Date: 2014-07-17 13:01:23 +0000 (Thu, 17 Jul 2014) Log Message: ----------- Fix for #992 (deadlock in QueryLog.log()). Note: The static StringBuilder can not be used if the parent query has child subqueries without running into a deadlock on the [sb] object. If there are no children, we could reuse the global static [sb] and the AbstractRunningQuery.lock(). However, log(IRunningQuery) is ONLY invoke by AbstractRunningQuery.cancel() and then only runs IFF QueryLog is @ INFO. Since this is a rare combination, allocating a new StringBuilder object here will not have an adverse impact on the heap and avoids the possibility of a deadlock. Modified Paths: -------------- branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/bop/engine/QueryLog.java Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/bop/engine/QueryLog.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/bop/engine/QueryLog.java 2014-07-17 11:31:54 UTC (rev 8564) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/bop/engine/QueryLog.java 2014-07-17 13:01:23 UTC (rev 8565) @@ -64,7 +64,6 @@ import com.bigdata.bop.solutions.SliceOp; import com.bigdata.btree.Tuple; import com.bigdata.counters.render.XHTMLRenderer; -import com.bigdata.rawstore.Bytes; import com.bigdata.rdf.sparql.ast.eval.AST2BOpJoins; import com.bigdata.striterator.IKeyOrder; @@ -73,7 +72,6 @@ * written. * * @author <a href="mailto:tho...@us...">Bryan Thompson</a> - * @version $Id: RuleLog.java 3448 2010-08-18 20:55:58Z thompsonbry $ */ public class QueryLog { @@ -101,75 +99,84 @@ log.info(QueryLog.getTableHeader()); } - /** - * A single buffer is reused to keep down the heap churn. - */ - final private static StringBuilder sb = new StringBuilder( - Bytes.kilobyte32 * 4); +// /** +// * A single buffer is reused to keep down the heap churn. +// */ +// final private static StringBuilder sb = new StringBuilder( +// Bytes.kilobyte32 * 4); /** - * Log rule execution statistics. + * Log rule execution statistics @ INFO. * * @param q * The running query. */ static public void log(final IRunningQuery q) { - if (log.isInfoEnabled()) { + if (!log.isInfoEnabled()) + return; - try { + try { - final IRunningQuery[] children = (q instanceof AbstractRunningQuery) ? ((AbstractRunningQuery) q) - .getChildren() : null; + final IRunningQuery[] children = (q instanceof AbstractRunningQuery) ? ((AbstractRunningQuery) q) + .getChildren() : null; - /* - * Note: We could use a striped lock here over a small pool of - * StringBuilder's to decrease contention for the single buffer - * while still avoiding heap churn for buffer allocation. Do - * this if the monitor for this StringBuilder shows up as a hot - * spot when query logging is enabled. - */ - synchronized (sb) { + /** + * Note: The static StringBuilder can not be used if the parent + * query has child subqueries without running into a deadlock on + * the [sb] object. If there are no children, we could reuse the + * global static [sb] and the AbstractRunningQuery.lock(). + * However, log(IRunningQuery) is ONLY invoke by + * AbstractRunningQuery.cancel() and then only runs IFF QueryLog + * is @ INFO. Since this is a rare combination, allocating a new + * StringBuilder object here will not have an adverse impact on + * the heap and avoids the possibility of a deadlock. + * + * @see <a href="http://trac.bigdata.com/ticket/992" > Deadlock + * between AbstractRunningQuery.cancel(), QueryLog.log(), + * and ArbitraryLengthPathTask</a> + */ + final StringBuilder sb = new StringBuilder(); +// synchronized (sb) + { - // clear the buffer. - sb.setLength(0); + // clear the buffer. + sb.setLength(0); - { - final Map<Integer/* bopId */, QueueStats> queueStats = ((ChunkedRunningQuery) q) - .getQueueStats(); + { + final Map<Integer/* bopId */, QueueStats> queueStats = ((ChunkedRunningQuery) q) + .getQueueStats(); - logSummaryRow(q, queueStats, sb); + logSummaryRow(q, queueStats, sb); - logDetailRows(q, queueStats, sb); - } + logDetailRows(q, queueStats, sb); + } - if (children != null) { + if (children != null) { - for (int i = 0; i < children.length; i++) { + for (int i = 0; i < children.length; i++) { - final IRunningQuery c = children[i]; - - final Map<Integer/* bopId */, QueueStats> queueStats = ((ChunkedRunningQuery) c) - .getQueueStats(); - - logSummaryRow(c, queueStats, sb); - - logDetailRows(c, queueStats, sb); + final IRunningQuery c = children[i]; + + final Map<Integer/* bopId */, QueueStats> queueStats = ((ChunkedRunningQuery) c) + .getQueueStats(); + + logSummaryRow(c, queueStats, sb); + + logDetailRows(c, queueStats, sb); - } - } + + } - log.info(sb); + log.info(sb); - } - - } catch (RuntimeException t) { - - log.error(t,t); - } + + } catch (RuntimeException t) { + log.error(t,t); + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tho...@us...> - 2014-07-17 11:32:02
|
Revision: 8564 http://sourceforge.net/p/bigdata/code/8564 Author: thompsonbry Date: 2014-07-17 11:31:54 +0000 (Thu, 17 Jul 2014) Log Message: ----------- Several changes related to the single-server jetty NSS deployment model (startNSS). build.xml: added comments about the purpose of the different log4j config files. bigdata-war/classes/log4j.properties: modified to NOT specify the FileAppender for the rules log so as to avoid forcing the creation of rules.log file. This tends to be problematic for people since the default directory often does not have sufficient permissions. startNSS: - Modified to fail if BD_HOME is not specified (and reports message). - Wrapped many environment variables in quotes to avoid problems when they are empty. This probably does not handle all edge cases with embedded whitespace yet. - Modified to report the command that is executed and the PID that results. - Modified to not send all output to /dev/null except for brew (the brew code path is probably incorrect, but I have kept the default behavior for now). Note: The bigdataNSS script can not be used to control the run state of the NSS process because it has some brew metavariables. See #918 (Unify the Bigdata Installation Trees) Modified Paths: -------------- branches/BIGDATA_RELEASE_1_3_0/bigdata-war/classes/log4j.properties branches/BIGDATA_RELEASE_1_3_0/build.xml branches/BIGDATA_RELEASE_1_3_0/src/resources/deployment/nss/bin/startNSS Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata-war/classes/log4j.properties =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-war/classes/log4j.properties 2014-07-17 10:52:42 UTC (rev 8563) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-war/classes/log4j.properties 2014-07-17 11:31:54 UTC (rev 8564) @@ -38,11 +38,14 @@ ## # Rule execution log. This is a formatted log file (comma delimited). +# Uncomment next line and also change from ConsoleAppender to FileAppender. +# Make sure that you can write on the specified file name and directory. #log4j.logger.com.bigdata.relation.rule.eval.RuleLog=INFO,ruleLog log4j.additivity.com.bigdata.relation.rule.eval.RuleLog=false -log4j.appender.ruleLog=org.apache.log4j.FileAppender +log4j.appender.ruleLog=org.apache.log4j.ConsoleAppender +#log4j.appender.ruleLog=org.apache.log4j.FileAppender log4j.appender.ruleLog.Threshold=ALL -log4j.appender.ruleLog.File=rules.log +#log4j.appender.ruleLog.File=rules.log log4j.appender.ruleLog.Append=true # I find that it is nicer to have this unbuffered since you can see what # is going on and to make sure that I have complete rule evaluation logs Modified: branches/BIGDATA_RELEASE_1_3_0/build.xml =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/build.xml 2014-07-17 10:52:42 UTC (rev 8563) +++ branches/BIGDATA_RELEASE_1_3_0/build.xml 2014-07-17 11:31:54 UTC (rev 8564) @@ -1171,6 +1171,7 @@ <property name="logging.to.path" location="${dist.var.config.logging}" /> + <!-- Note: normal server logging files. --> <property name="log4j.from.file" location="${bigdata.dir}/bigdata/src/resources/logging/log4j.properties" /> <copy file="${log4j.from.file}" todir="${logging.to.path}" /> @@ -1179,15 +1180,18 @@ <copy file="${logging.from.file}" todir="${logging.to.path}" /> + <!-- Note: scale-out logging files (standalone mode). --> <property name="standalone.log4j.from.file" location="${src.resources.config}/standalone/log4j.properties" /> <property name="standalone.log4j.to.file" location="${logging.to.path}/log4jStandalone.properties" /> <copy file="${standalone.log4j.from.file}" tofile="${standalone.log4j.to.file}" /> + <!-- Note: scale-out logging files (cluster mode). --> <property name="server.log4j.from.file" location="${src.resources.config}/log4jServer.properties" /> <copy file="${server.log4j.from.file}" todir="${logging.to.path}" /> + <!-- Note: HA replication cluster logging files. --> <property name="haserver.log4j.from.file" location="${src.resources}/HAJournal/log4jHA.properties" /> <copy file="${haserver.log4j.from.file}" todir="${logging.to.path}" /> Modified: branches/BIGDATA_RELEASE_1_3_0/src/resources/deployment/nss/bin/startNSS =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/src/resources/deployment/nss/bin/startNSS 2014-07-17 10:52:42 UTC (rev 8563) +++ branches/BIGDATA_RELEASE_1_3_0/src/resources/deployment/nss/bin/startNSS 2014-07-17 11:31:54 UTC (rev 8564) @@ -1,7 +1,11 @@ #!/bin/bash +if [ -z "${BD_HOME}" ]; then + echo "Not specified: BD_HOME"; + exit 1; +fi export INSTALL_DIR=${BD_HOME} -if [ $INSTALL_TYPE == "BREW" ]; then +if [ "${INSTALL_TYPE}" == "BREW" ]; then export LIB_DIR=${INSTALL_DIR}/libexec else export LIB_DIR=${INSTALL_DIR}/lib @@ -15,13 +19,13 @@ export LOG_DIR=${BD_HOME}/var/log -if [ ! -d $LOG_DIR ]; then - mkdir -p $LOG_DIR +if [ ! -d "${LOG_DIR}" ]; then + mkdir -p "${LOG_DIR}" fi export DATA_DIR=${BD_HOME}/var/data -if [ ! -d $DATA_DIR ]; then - mkdir -p $DATA_DIR +if [ ! -d "${DATA_DIR}" ]; then + mkdir -p "${DATA_DIR}" fi export NSS="com.bigdata.rdf.sail.webapp.NanoSparqlServer" @@ -56,8 +60,8 @@ # Setup the directory for the pid of the ServiceStarter process. lockDir=${INSTALL_DIR}/var/lock -if [ ! -d $lockDir ]; then - mkdir -p $lockDir +if [ ! -d "${lockDir}" ]; then + mkdir -p "${lockDir}" fi pidFile=$lockDir/pid @@ -70,8 +74,19 @@ $NSS_PROPERTIES\ " -# echo "Running: $cmd" -$cmd > /dev/null 2>&1 & +echo "Running: $cmd" +# Note: This redirects console logger output to dev/null! +# This is only valid if all logger output is explicitly +# directed into a file, which it is not when using the +# default log4j and java.util.logging configuration. I am +# leaving the brew installer behavior as its historical +# value to avoid breaking it, but it is very likely to be +# incorrect. +if [ "${INSTALL_TYPE}" == "BREW" ]; then + $cmd > /dev/null 2>&1 & +else + $cmd& +fi pid=$! # echo "PID=$pid" echo "$pid">$pidFile This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mar...@us...> - 2014-07-17 10:52:46
|
Revision: 8563 http://sourceforge.net/p/bigdata/code/8563 Author: martyncutcher Date: 2014-07-17 10:52:42 +0000 (Thu, 17 Jul 2014) Log Message: ----------- Added counters for BufferedWrite and fixed read counter for RWStore Modified Paths: -------------- branches/BIGDATA_MGC_SMALL_SLOTS/bigdata/src/java/com/bigdata/io/writecache/BufferedWrite.java branches/BIGDATA_MGC_SMALL_SLOTS/bigdata/src/java/com/bigdata/io/writecache/WriteCacheCounters.java branches/BIGDATA_MGC_SMALL_SLOTS/bigdata/src/java/com/bigdata/rwstore/RWStore.java branches/BIGDATA_MGC_SMALL_SLOTS/bigdata-perf/lubm/RWStore.properties branches/BIGDATA_MGC_SMALL_SLOTS/bigdata-perf/lubm/build.properties Added Paths: ----------- branches/BIGDATA_MGC_SMALL_SLOTS/bigdata-perf/lubm/log4j.properties Modified: branches/BIGDATA_MGC_SMALL_SLOTS/bigdata/src/java/com/bigdata/io/writecache/BufferedWrite.java =================================================================== --- branches/BIGDATA_MGC_SMALL_SLOTS/bigdata/src/java/com/bigdata/io/writecache/BufferedWrite.java 2014-07-16 21:56:39 UTC (rev 8562) +++ branches/BIGDATA_MGC_SMALL_SLOTS/bigdata/src/java/com/bigdata/io/writecache/BufferedWrite.java 2014-07-17 10:52:42 UTC (rev 8563) @@ -31,6 +31,7 @@ import com.bigdata.counters.CAT; import com.bigdata.counters.CounterSet; +import com.bigdata.counters.Instrument; import com.bigdata.io.DirectBufferPool; import com.bigdata.io.FileChannelUtility; import com.bigdata.io.IBufferAccess; @@ -295,4 +296,18 @@ return ret; } + public void addCounters(final CounterSet cs) { + cs.addCounter("ndataWrites", new Instrument<Long>() { + public void sample() { + setValue(m_dataWrites.get()); + } + }); + + cs.addCounter("nfileWrites", new Instrument<Long>() { + public void sample() { + setValue(m_fileWrites.get()); + } + }); + } + } Modified: branches/BIGDATA_MGC_SMALL_SLOTS/bigdata/src/java/com/bigdata/io/writecache/WriteCacheCounters.java =================================================================== --- branches/BIGDATA_MGC_SMALL_SLOTS/bigdata/src/java/com/bigdata/io/writecache/WriteCacheCounters.java 2014-07-16 21:56:39 UTC (rev 8562) +++ branches/BIGDATA_MGC_SMALL_SLOTS/bigdata/src/java/com/bigdata/io/writecache/WriteCacheCounters.java 2014-07-17 10:52:42 UTC (rev 8563) @@ -182,6 +182,9 @@ setValue(elapsedWriteNanos / 1000000000.); } }); + + // BufferedWrite counters + return root; Modified: branches/BIGDATA_MGC_SMALL_SLOTS/bigdata/src/java/com/bigdata/rwstore/RWStore.java =================================================================== --- branches/BIGDATA_MGC_SMALL_SLOTS/bigdata/src/java/com/bigdata/rwstore/RWStore.java 2014-07-16 21:56:39 UTC (rev 8562) +++ branches/BIGDATA_MGC_SMALL_SLOTS/bigdata/src/java/com/bigdata/rwstore/RWStore.java 2014-07-17 10:52:42 UTC (rev 8563) @@ -857,7 +857,7 @@ m_fd = fileMetadata.file; // initialize striped performance counters for this store. - this.storeCounters.set(new StoreCounters(10/* batchSize */)); + this.storeCounters.set(new StoreCounters(this, 10/* batchSize */)); final IRootBlockView m_rb = fileMetadata.rootBlock; @@ -2144,37 +2144,13 @@ // With a non-null WCS, the actual read should be via a callback to readRaw, it should not get here // unless it is not possible to cache - but maybe even then the WCS should read into a temporary // buffer - final long beginDisk = System.nanoTime(); - // If checksum is required then the buffer should be sized to include checksum in final 4 bytes + + // If checksum is required then the buffer should be sized to include checksum in final 4 bytes final ByteBuffer bb = ByteBuffer.wrap(buf, offset, length); // Use ReadRaw - should be the same read all readRaw(paddr, bb); - // enable for debug - if (false) {//FIXME EXTENSION_LOCK REQUIRED FOR IO. - final byte[] nbuf = new byte[buf.length]; - final ByteBuffer nbb = ByteBuffer.wrap(nbuf, offset, length); - FileChannelUtility.readAll(m_reopener, nbb, paddr); - if (!Arrays.equals(buf, nbuf)) - throw new AssertionError(); - - m_diskReads++; - // Update counters. - final StoreCounters<?> c = (StoreCounters<?>) storeCounters.get() - .acquire(); - try { - final int nbytes = length; - c.nreads++; - c.bytesRead += nbytes; - c.bytesReadFromDisk += nbytes; - c.elapsedReadNanos += (System.nanoTime() - begin); - c.elapsedDiskReadNanos += (System.nanoTime() - beginDisk); - } finally { - c.release(); - } - } - final int chk = ChecksumUtility.getCHK().checksum(buf, offset, length-4); // read checksum final int tstchk = bb.getInt(offset + length-4); if (chk != tstchk) { @@ -5540,26 +5516,40 @@ * #of times one of the root blocks has been written. */ public volatile long nwriteRootBlock; + + private final RWStore m_store; /** * {@inheritDoc} */ public StoreCounters() { super(); + + m_store = null; } + public StoreCounters(final RWStore store) { + super(); + + m_store = store; + } + /** * {@inheritDoc} */ - public StoreCounters(final int batchSize) { + public StoreCounters(final RWStore store, final int batchSize) { super(batchSize); + + m_store = store; } /** * {@inheritDoc} */ - public StoreCounters(final int nstripes, final int batchSize) { + public StoreCounters(final RWStore store, final int nstripes, final int batchSize) { super(nstripes, batchSize); + + m_store = store; } @Override @@ -5649,7 +5639,6 @@ ntruncate = 0; nreopen = 0; nwriteRootBlock = 0; - } @Override @@ -5670,6 +5659,12 @@ } }); + root.addCounter("ndiskRead", new Instrument<Long>() { + public void sample() { + setValue(ndiskRead); + } + }); + root.addCounter("bytesRead", new Instrument<Long>() { public void sample() { setValue(bytesRead); @@ -5742,9 +5737,16 @@ } }); + } // IRawStore - // disk statistics + // BufferedWriter + final BufferedWrite buffer = m_store.m_bufferedWrite; + if (buffer != null) { + buffer.addCounters(root.makePath("buffer")); + } + + // disk statistics { final CounterSet disk = root.makePath("disk"); @@ -6227,19 +6229,32 @@ final int position = dst.position(); try { + final long beginDisk = System.nanoTime(); + // the offset into the disk file. // final long pos = FileMetadata.headerSize0 + offset; final long pos = offset; + final int length = dst.limit(); // read on the disk. final int ndiskRead = FileChannelUtility.readAll(m_reopener, dst, pos); + m_diskReads += ndiskRead; + + final long now = System.nanoTime(); + // update performance counters. final StoreCounters<?> c = (StoreCounters<?>) storeCounters .get().acquire(); try { c.ndiskRead += ndiskRead; + final int nbytes = length; + c.nreads++; + c.bytesRead += nbytes; + c.bytesReadFromDisk += nbytes; + c.elapsedReadNanos += now - beginDisk; + c.elapsedDiskReadNanos += now - beginDisk; } finally { c.release(); } Modified: branches/BIGDATA_MGC_SMALL_SLOTS/bigdata-perf/lubm/RWStore.properties =================================================================== --- branches/BIGDATA_MGC_SMALL_SLOTS/bigdata-perf/lubm/RWStore.properties 2014-07-16 21:56:39 UTC (rev 8562) +++ branches/BIGDATA_MGC_SMALL_SLOTS/bigdata-perf/lubm/RWStore.properties 2014-07-17 10:52:42 UTC (rev 8563) @@ -12,7 +12,7 @@ com.bigdata.journal.AbstractJournal.bufferMode=DiskRW com.bigdata.rwstore.RWStore.smallSlotType=1024 -com.bigdata.btree.writeRetentionQueue.capacity=8000 +com.bigdata.btree.writeRetentionQueue.capacity=4000 com.bigdata.btree.BTree.branchingFactor=512 # Override branching factors for BSBM 100M to target 8k pages. @@ -51,8 +51,8 @@ #com.bigdata.namespace.BSBM_284826.spo.OSP.com.bigdata.btree.BTree.branchingFactor=512 # Override branching factors for BSBM 200M to target 8k pages. -com.bigdata.namespace.LUBM.lex.TERM2ID.com.bigdata.btree.BTree.branchingFactor=800 -com.bigdata.namespace.LUBM.lex.ID2TERM.com.bigdata.btree.BTree.branchingFactor=800 +com.bigdata.namespace.LUBM.lex.TERM2ID.com.bigdata.btree.BTree.branchingFactor=1024 +com.bigdata.namespace.LUBM.lex.ID2TERM.com.bigdata.btree.BTree.branchingFactor=1024 com.bigdata.namespace.LUBM.spo.SPO.com.bigdata.btree.BTree.branchingFactor=1024 #com.bigdata.namespace.LUBM.lex.TERM2ID.com.bigdata.btree.BTree.branchingFactor=256 #com.bigdata.namespace.LUBM.lex.ID2TERM.com.bigdata.btree.BTree.branchingFactor=256 @@ -60,7 +60,8 @@ # Override the #of write cache buffers. # com.bigdata.journal.AbstractJournal.writeCacheBufferCount=12 -com.bigdata.journal.AbstractJournal.writeCacheBufferCount=800 +com.bigdata.journal.AbstractJournal.writeCacheBufferCount=600 +com.bigdata.journal.AbstractJournal.readCacheBufferCount=200 # Note: You must override the buffer capacity in build.xml on the # "run-load" target, but this would give you 10M write cache buffers Modified: branches/BIGDATA_MGC_SMALL_SLOTS/bigdata-perf/lubm/build.properties =================================================================== --- branches/BIGDATA_MGC_SMALL_SLOTS/bigdata-perf/lubm/build.properties 2014-07-16 21:56:39 UTC (rev 8562) +++ branches/BIGDATA_MGC_SMALL_SLOTS/bigdata-perf/lubm/build.properties 2014-07-17 10:52:42 UTC (rev 8563) @@ -75,10 +75,10 @@ #lubm.journalFile=/Volumes/NonSSD/lubm/lubm3_${lubm.pc}/bigdata-lubm.${journalMode}.jnl # standard load -lubm.journalFile=/Volumes/SSDData/bigdata-perf/data/lubm/${lubm.pc}/bigdata-lubm-256-1024.RW.jnl +lubm.journalFile=/Volumes/SSDData/bigdata-perf/data/lubm/${lubm.pc}/bigdata-lubm-small-readcache-512-1024.RW.jnl # Use this to override journal copied to NonSSD volume -#lubm.journalFile=/Volumes/NonSSD/lubm/bigdata-lubm-small-64-256.RW.jnl +#lubm.journalFile=/Volumes/NonSSD/lubm/bigdata-lubm-512-1024.RW.jnl # Windows 2008 Server: SSD. Added: branches/BIGDATA_MGC_SMALL_SLOTS/bigdata-perf/lubm/log4j.properties =================================================================== --- branches/BIGDATA_MGC_SMALL_SLOTS/bigdata-perf/lubm/log4j.properties (rev 0) +++ branches/BIGDATA_MGC_SMALL_SLOTS/bigdata-perf/lubm/log4j.properties 2014-07-17 10:52:42 UTC (rev 8563) @@ -0,0 +1,79 @@ +## +# This is the default log4j configuration for distribution and CI tests. +## + +# Note: logging at INFO or DEBUG will significantly impact throughput! +log4j.rootCategory=WARN, dest2 + +log4j.logger.com.bigdata=WARN +log4j.logger.com.bigdata.btree=WARN +#log4j.logger.com.bigdata.rwstore=DEBUG +log4j.logger.com.bigdata.counters.History=ERROR +log4j.logger.com.bigdata.counters.XMLUtility$MyHandler=ERROR +log4j.logger.com.bigdata.counters.query.CounterSetQuery=INFO +log4j.logger.com.bigdata.journal.CompactTask=INFO +log4j.logger.com.bigdata.relation.accesspath.BlockingBuffer=ERROR +log4j.logger.com.bigdata.rdf.load=INFO +log4j.logger.com.bigdata.rdf.store.DataLoader=INFO +log4j.logger.com.bigdata.resources.AsynchronousOverflowTask=INFO + +#log4j.logger.com.bigdata.rdf.rio.StatementBuffer=ALL +#log4j.logger.com.bigdata.rdf.sail.TestProvenanceQuery=ALL +#log4j.logger.com.bigdata.rdf.sail.TestSids=ALL +#log4j.logger.com.bigdata.rdf.sail.ProxyBigdataSailTestCase=ALL + +# Test suite loggers. +#log4j.logger.junit=INFO +#log4j.logger.com.bigdata.btree.AbstractBTreeTestCase=INFO +log4j.logger.junit.framework.TestCase2=ERROR + +# dest1 +log4j.appender.dest1=org.apache.log4j.ConsoleAppender +log4j.appender.dest1.layout=org.apache.log4j.PatternLayout +log4j.appender.dest1.layout.ConversionPattern=%-5p: %r %l: %m%n +#log4j.appender.dest1.layout.ConversionPattern=%-5p: %m%n +#log4j.appender.dest1.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n +#log4j.appender.dest1.layout.ConversionPattern=%-4r(%d) [%t] %-5p %c(%l:%M) %x - %m%n + +# dest2 includes the thread name and elapsed milliseconds. +# Note: %r is elapsed milliseconds. +# Note: %t is the thread name. +# See http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/PatternLayout.html +log4j.appender.dest2=org.apache.log4j.ConsoleAppender +log4j.appender.dest2.layout=org.apache.log4j.PatternLayout +log4j.appender.dest2.layout.ConversionPattern=%-5p: %r %X{hostname} %X{serviceUUID} %X{taskname} %X{timestamp} %X{resources} %t %l: %m%n + +## destPlain +#log4j.appender.destPlain=org.apache.log4j.ConsoleAppender +#log4j.appender.destPlain.layout=org.apache.log4j.PatternLayout +#log4j.appender.destPlain.layout.ConversionPattern= + +## +# Summary query evaluation log (tab delimited file). +#log4j.logger.com.bigdata.bop.engine.QueryLog=INFO,queryLog +log4j.additivity.com.bigdata.bop.engine.QueryLog=false +log4j.appender.queryLog=org.apache.log4j.FileAppender +log4j.appender.queryLog.Threshold=ALL +log4j.appender.queryLog.File=queryLog.csv +log4j.appender.queryLog.Append=true +# I find that it is nicer to have this unbuffered since you can see what +# is going on and to make sure that I have complete rule evaluation logs +# on shutdown. +log4j.appender.queryLog.BufferedIO=false +log4j.appender.queryLog.layout=org.apache.log4j.PatternLayout +log4j.appender.queryLog.layout.ConversionPattern=%m + +## +# BOp run state trace (tab delimited file). Uncomment the next line to enable. +#log4j.logger.com.bigdata.bop.engine.RunState$TableLog=INFO,queryRunStateLog +log4j.additivity.com.bigdata.bop.engine.RunState$TableLog=false +log4j.appender.queryRunStateLog=org.apache.log4j.FileAppender +log4j.appender.queryRunStateLog.Threshold=ALL +log4j.appender.queryRunStateLog.File=queryRunState.log +log4j.appender.queryRunStateLog.Append=true +# I find that it is nicer to have this unbuffered since you can see what +# is going on and to make sure that I have complete rule evaluation logs +# on shutdown. +log4j.appender.queryRunStateLog.BufferedIO=false +log4j.appender.queryRunStateLog.layout=org.apache.log4j.PatternLayout +log4j.appender.queryRunStateLog.layout.ConversionPattern=%m This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tob...@us...> - 2014-07-16 21:56:47
|
Revision: 8562 http://sourceforge.net/p/bigdata/code/8562 Author: tobycraig Date: 2014-07-16 21:56:39 +0000 (Wed, 16 Jul 2014) Log Message: ----------- Added label for namespace shortcuts Modified Paths: -------------- branches/BIGDATA_RELEASE_1_3_0/bigdata-war/src/html/js/workbench.js Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata-war/src/html/js/workbench.js =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-war/src/html/js/workbench.js 2014-07-16 21:41:09 UTC (rev 8561) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-war/src/html/js/workbench.js 2014-07-16 21:56:39 UTC (rev 8562) @@ -373,7 +373,7 @@ } }; -$('.namespace-shortcuts').html(''); +$('.namespace-shortcuts').html('Namespace shortcuts: '); for(var category in NAMESPACE_SHORTCUTS) { var select = $('<select><option>' + category + '</option></select>').appendTo($('.namespace-shortcuts')); for(var ns in NAMESPACE_SHORTCUTS[category]) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tob...@us...> - 2014-07-16 21:41:17
|
Revision: 8561 http://sourceforge.net/p/bigdata/code/8561 Author: tobycraig Date: 2014-07-16 21:41:09 +0000 (Wed, 16 Jul 2014) Log Message: ----------- #837 - Improved namespace creation and cloning Modified Paths: -------------- branches/BIGDATA_RELEASE_1_3_0/bigdata-war/src/html/css/style.css branches/BIGDATA_RELEASE_1_3_0/bigdata-war/src/html/index.html branches/BIGDATA_RELEASE_1_3_0/bigdata-war/src/html/js/workbench.js Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata-war/src/html/css/style.css =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-war/src/html/css/style.css 2014-07-16 18:38:15 UTC (rev 8560) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-war/src/html/css/style.css 2014-07-16 21:41:09 UTC (rev 8561) @@ -359,6 +359,11 @@ background-color: tomato; } +#inference-quads-incompatible { + display: none; + font-style: italic; +} + #links { text-align: center; margin-top: 20px; Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata-war/src/html/index.html =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-war/src/html/index.html 2014-07-16 18:38:15 UTC (rev 8560) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-war/src/html/index.html 2014-07-16 21:41:09 UTC (rev 8561) @@ -244,11 +244,23 @@ <div class="box"> <h1>Create namespace</h1> <form id="namespace-create"> - <label for="new-namespace-name">Name:</label> <input type="text" id="new-namespace-name"><br> - <label for="new-namespace-index">Full text index:</label> <input type="checkbox" id="new-namespace-index"><br> - <label for="new-namespace-truth-maintenance">Truth maintenance:</label> <input type="checkbox" id="new-namespace-truth-maintenance"><br> - <label for="new-namespace-quads">Quads:</label> <input type="checkbox" id="new-namespace-quads"><br> - <label for="new-namespace-rdr">RDR:</label> <input type="checkbox" id="new-namespace-rdr"><br> + <label for="new-namespace-name">Name:</label> + <input type="text" id="new-namespace-name"> + <br> + <label for="new-namespace-mode">Mode:</label> + <select id="new-namespace-mode"> + <option>triples</option> + <option>rdr</option> + <option>quads</option> + </select> + <br> + <label for="new-namespace-inference">Inference:</label> + <input type="checkbox" id="new-namespace-inference"> + <span id="inference-quads-incompatible">Inference is incompatible with quads mode</span> + <br> + <label for="new-namespace-index">Full text index:</label> + <input type="checkbox" id="new-namespace-index"> + <br> <input type="submit" value="Create namespace"> </form> <ul id="namespace-create-errors"></ul> Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata-war/src/html/js/workbench.js =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-war/src/html/js/workbench.js 2014-07-16 18:38:15 UTC (rev 8560) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-war/src/html/js/workbench.js 2014-07-16 21:41:09 UTC (rev 8561) @@ -9,7 +9,8 @@ 'index': 'com.bigdata.rdf.store.AbstractTripleStore.textIndex', 'truthMaintenance': 'com.bigdata.rdf.sail.truthMaintenance', 'quads': 'com.bigdata.rdf.store.AbstractTripleStore.quads', - 'rdr': 'com.bigdata.rdf.store.AbstractTripleStore.statementIdentifiers' + 'rdr': 'com.bigdata.rdf.store.AbstractTripleStore.statementIdentifiers', + 'axioms': 'com.bigdata.rdf.store.AbstractTripleStore.axiomsClass' }; CODEMIRROR_DEFAULTS = { @@ -222,49 +223,64 @@ function cloneNamespace(namespace) { var url = RO_URL_PREFIX + 'namespace/' + namespace + '/properties'; $.get(url, function(data) { - var reversed_params = {}; - for(var key in NAMESPACE_PARAMS) { - reversed_params[NAMESPACE_PARAMS[key]] = key; - } + // collect params from namespace to be cloned + var params = {}; $.each(data.getElementsByTagName('entry'), function(i, entry) { - var key = entry.getAttribute('key'); - if(reversed_params[key] == 'name') { - return; - } - if(key in reversed_params) { - $('#new-namespace-' + reversed_params[key]).prop('checked', entry.textContent.trim() == 'true'); - } + params[entry.getAttribute('key')] = entry.textContent.trim(); }); + + // set up new namespace form with collected params + var mode, quads, rdr; + quads = params[NAMESPACE_PARAMS.quads] == 'true'; + rdr = params[NAMESPACE_PARAMS.rdr] == 'true'; + if(!quads && !rdr) { + mode = 'triples'; + } else if(!quads && rdr) { + mode = 'rdr'; + } else if(quads && !rdr) { + mode = 'quads'; + } else { + alert('Incompatible set of namespace parameters'); + return; + } + $('#new-namespace-mode').val(mode); + $('#new-namespace-inference').prop('checked', params[NAMESPACE_PARAMS.axioms] == 'com.bigdata.rdf.axioms.OwlAxioms'); + $('#new-namespace-index').prop('checked', params[NAMESPACE_PARAMS.index] == 'true'); + $('#new-namespace-name').focus(); }); } function validateNamespaceOptions() { var errors = []; - if(!$('#new-namespace-name').val().trim()) { + var name = $('#new-namespace-name').val().trim(); + if(!name) { errors.push('Enter a name'); } - if($('#new-namespace-truth-maintenance').is(':checked') && $('#new-namespace-quads').is(':checked')) { - errors.push('You may not select both truth maintenance and quads'); + $('#namespaces-list li').each(function() { + if(name == $(this).data('name')) { + errors.push('Name already in use'); + return false; + } + }); + if($('#new-namespace-mode').val() == 'quads' && $('#new-namespace-inference').is(':checked')) { + errors.push('Inference is incompatible with quads mode'); } - if($('#new-namespace-rdr').is(':checked') && $('#new-namespace-quads').is(':checked')) { - errors.push('You may not select both RDR and quads'); - } $('#namespace-create-errors').html(''); for(var i=0; i<errors.length; i++) { $('#namespace-create-errors').append('<li>' + errors[i] + '</li>'); } - var valid = errors.length == 0; - if(valid) { - $('#namespace-create input[type=submit]').removeAttr('disabled'); - } else { - $('#namespace-create input[type=submit]').attr('disabled', 'disabled'); - } return errors.length == 0; } -$('#namespace-create input').change(validateNamespaceOptions); -$('#namespace-create input').keyup(validateNamespaceOptions); +$('#new-namespace-mode').change(function() { + var quads = this.value == 'quads'; + $('#new-namespace-inference').prop('disabled', quads); + $('#inference-quads-incompatible').toggle(quads); + if(quads) { + $('#new-namespace-inference').prop('checked', false); + } +}); function createNamespace(e) { e.preventDefault(); @@ -273,18 +289,38 @@ } // get new namespace name and config options var params = {}; + params.name = $('#new-namespace-name').val().trim(); params.index = $('#new-namespace-index').is(':checked'); - params.truthMaintenance = $('#new-namespace-truth-maintenance').is(':checked'); - params.quads = $('#new-namespace-quads').is(':checked'); - params.rdr = $('#new-namespace-rdr').is(':checked'); - // TODO: validate namespace + + var mode = $('#new-namespace-mode').val(); + if(mode == 'triples') { + params.quads = false; + params.rdr = false; + params.truthMaintenance = true; + } else if(mode == 'rdr') { + params.quads = false; + params.rdr = true; + params.truthMaintenance = true; + } else { // quads + params.quads = true; + params.rdr = false; + params.truthMaintenance = false; + } + + if($('#new-namespace-inference').is(':checked')) { + params.axioms = 'com.bigdata.rdf.axioms.OwlAxioms'; + } else { + params.axioms = 'com.bigdata.rdf.axioms.NoAxioms'; + } + // TODO: allow for other options to be specified var data = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>\n<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">\n<properties>\n'; for(key in NAMESPACE_PARAMS) { data += '<entry key="' + NAMESPACE_PARAMS[key] + '">' + params[key] + '</entry>\n'; } data += '</properties>'; + var settings = { type: 'POST', data: data, @@ -1358,6 +1394,7 @@ if(e) { e.preventDefault(); } + showQueries(true); $.get(RO_URL_PREFIX + 'status', function(data) { // get data inside a jQuery object data = $('<div>').append(data); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mrp...@us...> - 2014-07-16 18:38:18
|
Revision: 8560 http://sourceforge.net/p/bigdata/code/8560 Author: mrpersonick Date: 2014-07-16 18:38:15 +0000 (Wed, 16 Jul 2014) Log Message: ----------- fixing the ant build Modified Paths: -------------- branches/SESAME_2_7/build.properties Removed Paths: ------------- branches/SESAME_2_7/bigdata-rdf/lib/openrdf-sesame-2.6.10-onejar.jar branches/SESAME_2_7/bigdata-rdf/lib/sesame-rio-testsuite-2.6.10.jar Deleted: branches/SESAME_2_7/bigdata-rdf/lib/openrdf-sesame-2.6.10-onejar.jar =================================================================== (Binary files differ) Deleted: branches/SESAME_2_7/bigdata-rdf/lib/sesame-rio-testsuite-2.6.10.jar =================================================================== (Binary files differ) Modified: branches/SESAME_2_7/build.properties =================================================================== --- branches/SESAME_2_7/build.properties 2014-07-16 16:05:36 UTC (rev 8559) +++ branches/SESAME_2_7/build.properties 2014-07-16 18:38:15 UTC (rev 8560) @@ -29,7 +29,7 @@ javac.encoding=Cp1252 # javacc is required to compile the SPARQL grammar. -javacc.home=/usr/java/javacc-5.0 +javacc.home=/Users/mikepersonick/Documents/javacc-5.0 ## # Versions to use of various dependencies. @@ -47,7 +47,7 @@ # icu.version=4.8 zookeeper.version=3.4.5 -sesame.version=2.6.10 +sesame.version=2.7.11 slf4j.version=1.6.1 jetty.version=9.1.4.v20140401 #jetty.version=7.2.2.v20101205 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |