Jump to content
We've recently updated our Privacy Statement, available here ×

eddiaz

Members
  • Posts

    7
  • Joined

  • Last visited

eddiaz's Achievements

Rookie

Rookie (2/14)

  • Week One Done
  • One Month Later
  • One Year In
  • First Post Rare
  • Conversation Starter Rare

Recent Badges

0

Reputation

  1. Data[toc on_off::hide=1] Sample data is created following these considerations Each row represents a credit card There is a single column family, which is creditcard_family Each qualifier represents a transaction's timestamp Each value is the amount for the transaction represented by the qualifier Values are randomly generated using a Gaussian generator with the following restrictions: Mean : 500 Deviation : 200 Minimum value: 10 Only USD and EU currencies are supportedTwo tables are created with different qualifier serialization: creditcard Serializes the qualifier using the DefaultDeserializer Qualifier name has the following structure: CURRENCY + __ + TIME_STAMP Timestamp is formatted with the expression: yyyy/MM/dd HH:mm:ss:SSS customcreditcard Uses CreditCardDeserializer Serializes qualifier using the first byte as the currency placeholder Tables are reset daily at 04 UTC time Queries The following creditcard query retrieves all the transactions and group only the ones with USD currency, assigning them to the fields transaction_date and transaction_amount{ "tableName" : "creditcard", "deserializerClass" : "com.jaspersoft.hbase.deserialize.impl.DefaultDeserializer", "qualifiersGroup" : { "qualifiersExpression" : "creditcard_family|.*", "qualifierJrField" : "transaction_date", "valueJrField" : "transaction_amount" } } This query filters the USD transactions for a time period using ColumnRangeFilter against customcreditcard table:{ "tableName" : "customcreditcard", "deserializerClass" : "com.jaspersoft.sample.deserializer.CreditCardDeserializer", "qualifiersGroup" : { "qualifiersExpression" : "creditcard_family|USD_.*", "qualifierJrField" : "charge", "valueJrField" : "details" }, "filter" : { "ColumnRangeFilter" : { "minColumn" : "USD__2012/04/12 17:05", "maxColumn" : "USD__2012/04/12 17:0", "minColumnInclusive" : true, "maxColumnInclusive" : true } } } The sample application data generator and deserializer are here HBase-sample.zip
  2. Background[toc on_off::hide=1] Jaspersoft and 10gen delivered a webinar on 29 March 2012 showing how the two technologies work together. Refer to the webinar archives for details. PrerequisitesInstall MongoDB and JasperReports Server. Then you can use these samples. SamplesLogs_bson_2012-03-29.zipLog_Analysis_2012-03-29.zipInstructionsSample data can be inserted into MongoDB like this: # Database name is "test" # Collection name is "logs" mongoimport -d test -c logs /tmp/logs14.bson Sample reports (with data source definition, images, dashboards, etc.) can be imported into JasperReports server like this: ./js-import.sh --import-zip Log_Analysis.zip Once the import is finished update MongoDB in the Cloud datasource with the proper Mongo URI. The datasource can be found on JasperReportsServer repository under Data Sources See AlsoMongoDB Resources
  3. Complete samples coming soonFor now you should download the source available in the "Release" section of this project. The unit tests include working examples of MongoDB reports and examples of how to compile and run them. Here's a code snippet to get you started: private final static String REPORT_NAMES = { "MongoDbReport", "MongoDbConditionalOperators", "MongoDbDates", "MongoDbGeospatial", "MongoDbRegEx", "MongoDbReport_AdHoc" }; @Test public void testReport() { String mongoURI = "mongodb://bdsandbox6:27017/test"; MongoDbConnection connection = null; Map parameters = new HashMap(); try { connection = new MongoDbConnection(mongoURI, null, null); parameters.put(MongoDbDataSource.CONNECTION, connection); File jasperFile; for (String reportname : REPORT_NAMES) { jasperFile = new File(PATH + reportname + ".jasper"); if (!jasperFile.exists()) { JasperCompileManager.compileReportToFile(PATH + reportname + ".jrxml", PATH + reportname + ".jasper"); } JasperFillManager.fillReportToFile(PATH + reportname + ".jasper", parameters); JasperExportManager.exportReportToPdfFile(PATH + reportname + ".jrprint"); } } catch (Exception e) { logger.error(e); } finally { if (connection != null) { connection.close(); } } You can also leverage the connection pooling feature to handle your connections. For instance: @Test public void testManager() { String mongoURI = "mongodb://bdsandbox6:27017/test"; MongoDbConnection connection = null; MongoDbConnectionManager connectionManager = null; Map parameters = new HashMap(); try { connectionManager = new MongoDbConnectionManager(); connectionManager.setMongoURI(mongoURI); connection = connectionManager.borrowConnection(); parameters.put(MongoDbDataSource.CONNECTION, connection); File jasperFile; for (String reportname : REPORT_NAMES) { jasperFile = new File(PATH + reportname + ".jasper"); if (!jasperFile.exists()) { JasperCompileManager.compileReportToFile(PATH + reportname + ".jrxml", PATH + reportname + ".jasper"); } JasperFillManager.fillReportToFile(PATH + reportname + ".jasper", parameters); JasperExportManager.exportReportToPdfFile(PATH + reportname + ".jrprint"); } } catch (Exception e) { logger.error(e); } finally { if (connection != null) { connectionManager.returnConnection(connection); } connectionManager.shutdown(); } } The connection pool offers the option to set the Mongo URI, username and password (if applicable), also the connections will be validated to full fit these properties before they are borrowed, so it's safe to change them during the connection manager existence. Thanks LissaCoffey
  4. eddiaz

    Jaspersoft HBase iReport

    Jaspersoft StudioFollowing are the steps to install the plugin on Jaspersoft Studio or Eclipse with Jaspersoft Studio plugin [toc]Install Jaspersoft Studio plugin on Eclipse Jaspersoft Studio's ReleasesDownload HBase plugin for Jaspersoft StudioIf Eclipse dropins is not configured follow these steps:Shutdown EclipseCreate a directory to be used as the default dropins oneEdit eclipse.ini and add the following line, replacing DROPINS_DIRECTORY_PATH with the full path of the directory previously created -Dorg.eclipse.equinox.p2.reconciler.dropins.directory=DROPINS_DIRECTORY_PATH Copy the downloaded plugin in the Eclipse dropins directoryRestart EclipseTo verify that the plugin was successfully created you can follow these steps: Go to Help -> About Eclipse -> Installation Details and click on the Plug-ins tabLook for Plug-in name HBase Plugin For an alternative approach, see How to use Apache Phoenix JDBC driver to run reports on HBase.
  5. $and and $or operators works with arrays rather than with maps as stated here Here is your query modified { collectionName : 'Encounters', findQuery : { $and : [ { bsBeginDT : { $ne : null } }, { bsBeginDT : { $ne : '' } } ] } } MongoDbDataSource 0.12 is published now with new features like (as you may noticed) avoiding quotes for Map keys Please let us know how this goes for you Eric Post Edited by eddiaz at 02/15/2012 17:35
  6. John, We had upgraded our hbase 0.91-SNAPSHOT instance to the latest revision and we were able to reproduce the error you got about Master not running. In order to fix this problem please upgrade the hbase binary shipped with iReport HBasePlugin with the one you have in your hbase instance. Base on the log you provided us the path for this binary is: /home/hadoop/.ireport/4.0.0/modules/ext/org.apache.hbase/ Please let us know how it goes - Eric
  7. John, HBasePlugin 0.7 ships with Hadoop HBase 0.91-SNAPSHOOT so there shoudn't be compatibility issues. We have tested the plugin/datasource against HBase in "Pseudo Distributed Mode" so it starts its own Zookeeper instance. Is your configuration different? Also, could you provide details on how you connected to HBase with the simple Java clients? - Eric Post Edited by eddiaz at 09/08/2011 01:25
×
×
  • Create New...