When working with AWS (specifically AWS EMR hadoop), you can use the S3distcp to concatenate files together with the --groupBy option. What is really cool, this will work even on already-compressed (gzip) files!
However, recursive sub-directories are not natively supported by S3distcp. So instead, need to stage it. To stage, we are going to use the distcp that S3distcp originated from as it has some other useful features not in s3distcp.
Using AWS EMR you can create a Custom JAR step, and either use the /usr/lib/hadoop/hadoop-distcp.jar or upload your own version of hadoop-distcp.jar to S3 and reference that version. Then, for args you want to copy the contents with the --update to a destination staging area where the individual files are stored in a flattened directory structure. In this example, I'll filter to just csv.gz files.
ARGS:
--update s3://test/raw/**/*.csv.gz s3://test/staging
After that, then you can use the command-runner.jar to concatenate in any grouping defined by the regular expression. The example used is by 4-digits (years for examples) in the filenames, such that all the daily/monthly files are put together into a single year file. The -outputCodec gz ensures that the ending file is also compressed.
ARGS:
s3-dist-cp --src=s3://test/staging --dest=s3://test/grouped/ --groupBy .*([0-9][0-9][0-9][0-9]).* --outputCodec gzip
If you get errors like "ERROR: Skipping key XYZ because it ends with '/'", this is usually because either there are no source files, or the regex in your groupBy is not quite correct and filters out to no files.
Tuesday, February 23, 2016
Saturday, October 10, 2015
Gamer Post (non development) Star Citizen coupon credits
For any gamers interested in the up and coming space epic Star Citizen from Robert Space Industries / Cloud Imperium (and their pretty impressive FPS star marine for planet and capital ship capture integration), My referral code now can get you 5,000 credits in game that you wouldn't otherwise! (p.s. you can register an account now before you forget without obligation, the 5000 will be waiting for you)
STAR-D9GQ-3T44
Trying to spread the word and give people a little boost to get started!
Sunday, May 10, 2015
New development (visual) perspective
It has been a while since my last post. I've been quite overwhelmed with additional challenges that have been overcome one at a time.
However, being a passionate technologist, always looking for ways to make myself and my team more ready to take on the next challenge.
For that goal, for the last couple of months I've been evaluating AR, VR, and 'Holo' alternatives to provide a different 'perspective' on heads-down development ecosystem/environment.
Key findings (end of Q1/2015):
However, being a passionate technologist, always looking for ways to make myself and my team more ready to take on the next challenge.
For that goal, for the last couple of months I've been evaluating AR, VR, and 'Holo' alternatives to provide a different 'perspective' on heads-down development ecosystem/environment.
Key findings (end of Q1/2015):
- AR, Augmented Reality / overlay over real world, such as those by Google Glass, Meta (Pro), Atheena, Vuzix, are all trying to take on many things at once. I, for one, do not need a head-mounted camera, especially when you will always have a phone with you which has a better camera anyway -- and as far as using the camera itself for AR, rather use the 'smartglass' as a portable monitor rather than full AR.
- Extra features not needed (camera)
- needs to be 'socially acceptable', particularly in meetings. Privacy concerns exist also around the camera, so drop camera, or provide (obvious marked?) option that does not include the camera.
- Intent One for supportive information, lookup/confirmation in meetings.
- Intent Two for development environment where not limited to single-pane monitor. Need higher resolution (i.e. 1600x1200) to be useful.
- Hololens (microsoft). They do not provide any actual specifications. So...vaporware for the time being. Interesting concept, but not likely to impress compared to VR.
- VR, Virtual Reality, where no attempt to overlay the real world. Provide 'high quality media' (i.e. gaming experience), so no camera, focus on video resolution, sound, and hopefully eye fatigue challenges.
- Project Morpheous, Sony/PS4 specific, not relevant as need for PC platform.
- Occulus Rift. Very popular, but the newer consumer version is targeted for 2016.
- Valve/Steam HTC Hive. Likely best candidate, high resolution display, with SteamOS intent for multi-OS environments (windows, linux, SteamOS), very good for both traditional business and gaming development shops. Target for end of 2015.
- Bonus: Valve/Steam is also a nice distribution platform in itself. One of my personal goals was to help provide 'optimized' development environments per projects. By Integrating into Steam as a distribution platform and provide 'modules' or 'add-ons' that provide the optimized environment/experience, a faster bootstrap process for new developers.
HTC Hive is not selling their development kits like Occulus, an interesting move. I've submitted an application for my team (as an independent) to try to provide another 'perspective' to development.
http://steamcommunity.com/games/250820/announcements/detail/154588645663414820
Thursday, October 09, 2014
Alfresco Startup time
As some of you may know, Alfresco is an EDMS that runs on tomcat (or other java container) in linux or windows.
I've been working with Alfresco for several years in various capacity, and anyone who works with Alfresco Community Edition (CE) knows that configuration changes require restart, and the restart is painfully slow....like 5 minutes slow.
Although some of the 'obvious' fixes are to move alfresco.war and share.war to independent tomcats, and only restart the one that you need, that is still configuration/integration/new possible issue point (particularly if you are doing low-volume sites and want to use only one tomcat/server).
The 'performance' is always relative to the hardware you are using, and some the time will vary depending on big cpu/slow disk, low-end cpu/high-end disk, etc. As such, will simply provide a baseline which is Alfresco 4.2.f, the bitnami linux installer on fedora.
All of these tests are with a baseline alfresco install, no content, no indexing.
So, some quick wins for decent return depending how much you want to modify your install. However, at the end of the day the startup is CPU (single-thread) bound. Now, some of you may remember the older Jboss application servers (4-6 series) and how they were getting slower and slower on startup, then they re-engineered there startup process for *controlled* parallel startup of services. That may be what is really needed to get the Alfresco CE startup time down.
Recommend the second to the last - setting up a ramdrive for that little of a gain is not worth it, and if you are really trying to push startup times, then get your alfresco and share on different tomcat instances first before moving to ramdrive.
I've been working with Alfresco for several years in various capacity, and anyone who works with Alfresco Community Edition (CE) knows that configuration changes require restart, and the restart is painfully slow....like 5 minutes slow.
Although some of the 'obvious' fixes are to move alfresco.war and share.war to independent tomcats, and only restart the one that you need, that is still configuration/integration/new possible issue point (particularly if you are doing low-volume sites and want to use only one tomcat/server).
The 'performance' is always relative to the hardware you are using, and some the time will vary depending on big cpu/slow disk, low-end cpu/high-end disk, etc. As such, will simply provide a baseline which is Alfresco 4.2.f, the bitnami linux installer on fedora.
All of these tests are with a baseline alfresco install, no content, no indexing.
| Relative startup time | Configuration | Notes |
|---|---|---|
| 0% (baseline) | -XX:+UseG1GC -XX:MaxPermSize=256M -Xms1024M -Xmx1024 | Bitnami base setup, 1024M heap. |
| -59% (slower, minutes dep. on hardware) | -XX:+UseG1GC -XX:MaxPermSize=256M -Xms256M -Xmx256M | Comparison when trying low memory (256M), how much of a difference it makes. |
| +0-5% (trivial) | -XX:+UseG1GC -XX:MaxPermSize=256M -Xms2048M -Xmx2048M | Excess ram (for startup) does not impact startup time. Note however you usually should have 2G-8G for normal, real-world, usage |
| +12% faster (20 sec dep. on hardware) | -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:MaxPermSize=256M -Xms2048M -Xmx2048M | Changing to a Concurrent GC (because we know CPU is maxed) actually made a good difference (assuming you are not heavily disk IO bound). |
| +14% faster | -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:MaxPermSize=256M -Xms2048M -Xmx2048M
put tomcat/alfresco/openoffice in a ramdrive to remove disk IO concerns (/dev/shm for example) |
Keeping to the most performing setup, try ramdrive to challenge disk IO issues...really aren't an issue in startup. However...your alf_data location absolute has an impact on real-world content. |
| +8% faster (slower than ConGC with defaults) | -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:MaxPermSize=256M -Xms2048M -Xmx2048M -XX:SurvivorRatio=8 -XX:TargetSurvivorRatio=90 -XX:MaxTenuringThreshold=31 | Additional GC tuning (out of quick/ignorant, didn't want to spend a lot of time on this). Just used what was from Http://www.oracle.com/technetwork/java/tuning-139912.html#section4.2.6 |
| +18% faster | -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:MaxPermSize=256M -Xms2048M -Xmx2048M
Modify /alfresco/WEB-INF/web.xml and /share/WEB-INF/web.xml with metadata-complete=true and absolute-ordering |
Most performant memory setup, then added this find: http://wiki.apache.org/tomcat/HowTo/FasterStartUp Obviously not a solution if using stock or as-is installer approach, but if you can customize your WAR (not just the exploded directory) surprising gains. |
| +20% faster (memory change, small app conf change, ramdrive) | -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:MaxPermSize=256M -Xms2048M -Xmx2048M
Modify /alfresco/WEB-INF/web.xml and /share/WEB-INF/web.xml with metadata-complete=true and absolute-ordering, ramdrive tomcat/alfresco/openoffice |
putting it all together, the 'quickest' fast startup option if you have the ram for it, but disk io isn't an issue with startup. |
Recommend the second to the last - setting up a ramdrive for that little of a gain is not worth it, and if you are really trying to push startup times, then get your alfresco and share on different tomcat instances first before moving to ramdrive.
Tuesday, January 15, 2013
Sharepoint 2013 w/ Apache Chemistry CMIS
Sharing my experience in trying to use the CMIS library to work with Sharepoint 2013. As a prefix, I have existing code integrated into a CEVA (content-enabled vertical application, that seems to be the buzzword) using Alfresco 4.2 CE as a backend, and evaluating compatibility of the system with a Sharepoint 2013 backend (I'm not swapping to sharepoint, just cross-checking).
I use 'sp2013' for the server name, replace as appropriate.
-Darren
I use 'sp2013' for the server name, replace as appropriate.
- Work with CMIS-Workbench as your go-to tool for confirmation before working with your code. This is like your SoapUI when working with Webservices, or your Database Editor tool when trying to write queries for your application. Work through everything you want to do with CMIS Workbench *first* before you write code.
- Sharepoint 2013 setup notes:
- Sharepoint Central Admin (http://sp2013:90/):
- Security, under 'General Security' section, 'Specify Authentication Providers'.
- Pick the default zone, or if you know Sharepoint the appropriate zone.
- Under Windows Auth, I had to enable 'basic auth'...I also disabled integrated as my intent was to use Sharepoint soley as a repository, so no need to get the system confused between integrated or basic auth (obviously, if using this route in production, need to setup SSL).
- Site Settings (http://sp2013):
- Pick the site you want to access through CMIS (for example, 'Documents').
- In the upper right, beside the login name, is a 'gear' icon for settings - click that, go to 'Site Settings'.
- Under 'Site Action' header is a 'Manage Site Features' link, click that.
- Activate 'Content Management Interoperability Services (CMIS) Producer'
- Repeat for each site you want to access. Each site will appear as a unique Repository from the CMIS point of view.
- Again, use CMIS Workbench for all your confirmation/testing. Add some files/folders to the above Site(s)/Repo(s) you shared for CMIS.
- Connect to the URL http://sp2013/cmis/rest/?getRepositories through CMIS Workbench. You will likely use this one for your apache chemistry code as well.
- For Apache Chemistry, Lesson learned --
- DO NOT try to create a session by re-using your Map
param and add in the repo ID...instead, get the Repository object directly, and use the Repository.createSession(). - For example of best-approach/usage of the Apache Chemistry CMIS library, look at the CMIS Workbench source code (that is how I learned the above error/correction).
- There are some CMIS functions that DO NOT work with Sharepoint 2013. I ran into only one and have not done a thorough review, but this already delayed me significantly:
- SCORE() does not work in Sharepoint 2013
-Darren
Monday, December 03, 2012
Document Management - CMIS 1.1 protocol approved
With apparently very little fanfare, CMIS 1.1 passed the final votes to become an approved specification.
https://www.oasis-open.org/committees/download.php/47441/ballot_2311.html
Now, some people may come to this blogpost and ask the question: "What is CMIS and what is great about 1.1 being approved?"
CMIS is an attempt to standardize the protocol to communicate with document/content management systems (EDMS/ECM). These systems have been around for ages (>15 years?). But they are ruled by large, proprietary giants who protect their investments by making sure that once you are integrated with them, you are locked into them without another large investment to re-develop/design all those integrations into another proprietary system. These may not have been malicious decisions, but attempts to provide value add, but the end result is the same --- you get locked in.
History:
WebDAV - a protocol that some of them started to follow. A good protocol. But lacked standard query support and repository/administration support.
JCR - Java Content Repository (two different revisions over time). Java-specific, attempt to define *how* to build a content repository, the underlying piece of an EDMS/ECM, but didn't exactly define a good integration/interaction protocol for clients or other tools. However, this did plant the seed to create various open source alternative EDMS/ECMs, so thank you (although it is java-specific, at least someone started something!)
CMIS 1.0 - after JCR, CMIS came into play as a language-agnostic way to search and retrieve documents (atompub & webservice versions).
So...what is so great about CMIS 1.1? It brings:
* standard way to create custom object types (content models, document types, etc) through a common/standard protocol instead of relying on each vendor to provide their own mechnism.(2.1.10 Object-Type Creation, Modiļ¬cation and Deletion)
* standard way to support 'mixin', or reuse, of properties using 'secondary types' (2.1.9 Secondary Object-Types)
With these two very important features, you can now create, search, retrieve, and (partially) maintain your content completely through a standard protocol, allowing creation of tools and interfaces against the protocol instead of vendor-specific implementations.
Do not get me wrong, the innovators in this space (Alfresco for example) provided vendor-specific value adds before the industry caught up, but some people, like myself, were resistant to those vendor-specific value-adds until can interoperate with other solutions. To say you picked a solution *only* because a value add feels like a lockin. To say you picked a solution above all others using the same features (CMIS 1.1 protocol) says a LOT more :-)
CMIS standard: http://docs.oasis-open.org/cmis/CMIS/v1.1/CMIS-v1.1.html
https://www.oasis-open.org/committees/download.php/47441/ballot_2311.html
Now, some people may come to this blogpost and ask the question: "What is CMIS and what is great about 1.1 being approved?"
CMIS is an attempt to standardize the protocol to communicate with document/content management systems (EDMS/ECM). These systems have been around for ages (>15 years?). But they are ruled by large, proprietary giants who protect their investments by making sure that once you are integrated with them, you are locked into them without another large investment to re-develop/design all those integrations into another proprietary system. These may not have been malicious decisions, but attempts to provide value add, but the end result is the same --- you get locked in.
History:
WebDAV - a protocol that some of them started to follow. A good protocol. But lacked standard query support and repository/administration support.
JCR - Java Content Repository (two different revisions over time). Java-specific, attempt to define *how* to build a content repository, the underlying piece of an EDMS/ECM, but didn't exactly define a good integration/interaction protocol for clients or other tools. However, this did plant the seed to create various open source alternative EDMS/ECMs, so thank you (although it is java-specific, at least someone started something!)
CMIS 1.0 - after JCR, CMIS came into play as a language-agnostic way to search and retrieve documents (atompub & webservice versions).
So...what is so great about CMIS 1.1? It brings:
* standard way to create custom object types (content models, document types, etc) through a common/standard protocol instead of relying on each vendor to provide their own mechnism.(2.1.10 Object-Type Creation, Modiļ¬cation and Deletion)
* standard way to support 'mixin', or reuse, of properties using 'secondary types' (2.1.9 Secondary Object-Types)
With these two very important features, you can now create, search, retrieve, and (partially) maintain your content completely through a standard protocol, allowing creation of tools and interfaces against the protocol instead of vendor-specific implementations.
Do not get me wrong, the innovators in this space (Alfresco for example) provided vendor-specific value adds before the industry caught up, but some people, like myself, were resistant to those vendor-specific value-adds until can interoperate with other solutions. To say you picked a solution *only* because a value add feels like a lockin. To say you picked a solution above all others using the same features (CMIS 1.1 protocol) says a LOT more :-)
CMIS standard: http://docs.oasis-open.org/cmis/CMIS/v1.1/CMIS-v1.1.html
Monday, July 02, 2012
Laptop build
Although I was looking for a pre-installed linux laptop, found a too-good deal on a thinkpad x230t with sufficient capabilities for xen server needs while in a compact 12" formfactor.
Step 1: Shrink the volume on the default Windows 7 install. Windows provides better support now adays for volume resizing. If you go to the control panel, search for 'partition' as a key word, you will see the disk management tools. This provides you the ability to shrink the volume....sort of. It appears it isn't an exact tool, and you will need to shrink, reboot, defrag, reboot, then shrink some more...repeating....until you get to the target size desired. I was aiming for 120GB, and it took 4 tries to get there.
Step 2: Backup the Windows image Although there is the familiar Ghost image software if you have the money, I wanted to look at alternatives. Lenovo provide it's own backup/restore software that looks like it would work well. I got a backup USB harddrive (not USB flash), and the Lenovo Thinkvantage backup/restore did the MBR and backup images flawlessly. However, being an individual that wanted to avoid lockin, and try to move towards automation/repeatable provisioning, I kept looking.
Cobbler is a tool I'm keep falling back to for image-based provisioning (versus kickstart-based installs), and it has support for provisioning images from Clonezilla (http://clonezilla.org). Clonezilla has support for Windows imaging, sharing my findings:
1) Reformat your external device (usb harddrive in my case) to have a smaller partition, such as 250MB, with a FAT32 filesystem as the first partition on that device. This is important to avoid a lot of trial/error - other versions of FAT will not work, and too-large volume causes problems. Don't worry, you still want a second partition that is much larger (at least 32GB) to store the actual images.
2) Use tuxboot.exe. Clonezilla highly recommends it, and they are right to do so. Once you get the partition straightened out, everything else is cakewalk. And, yes, you can use it directly from Windows without requiring to have a linux install.
3) plug your device into the Windows machine you want to image. If it is only for one machine, good-to-go. If you are trying to create a 'gold image' for distributing to multiple machines at once, look into 'sysprep' and other tools to prepare the windows install.
4) reboot your machine, and use your bios to choose the alternate start location. If you do not see your device, some of the USB3.0 ports/devices are not recognizable as bootable locations, so plug into a usb2.0 port to be sure.
5) the provided directions with clonezilla were excellent! If you want to review beforehand, you can check their site. Create the image, store it in the large partition, takes about 40min (minimal windows install) to create image then do a double check.
That is all for tonight, more updates later.....
Step 1: Shrink the volume on the default Windows 7 install. Windows provides better support now adays for volume resizing. If you go to the control panel, search for 'partition' as a key word, you will see the disk management tools. This provides you the ability to shrink the volume....sort of. It appears it isn't an exact tool, and you will need to shrink, reboot, defrag, reboot, then shrink some more...repeating....until you get to the target size desired. I was aiming for 120GB, and it took 4 tries to get there.
Step 2: Backup the Windows image Although there is the familiar Ghost image software if you have the money, I wanted to look at alternatives. Lenovo provide it's own backup/restore software that looks like it would work well. I got a backup USB harddrive (not USB flash), and the Lenovo Thinkvantage backup/restore did the MBR and backup images flawlessly. However, being an individual that wanted to avoid lockin, and try to move towards automation/repeatable provisioning, I kept looking.
Cobbler is a tool I'm keep falling back to for image-based provisioning (versus kickstart-based installs), and it has support for provisioning images from Clonezilla (http://clonezilla.org). Clonezilla has support for Windows imaging, sharing my findings:
1) Reformat your external device (usb harddrive in my case) to have a smaller partition, such as 250MB, with a FAT32 filesystem as the first partition on that device. This is important to avoid a lot of trial/error - other versions of FAT will not work, and too-large volume causes problems. Don't worry, you still want a second partition that is much larger (at least 32GB) to store the actual images.
2) Use tuxboot.exe. Clonezilla highly recommends it, and they are right to do so. Once you get the partition straightened out, everything else is cakewalk. And, yes, you can use it directly from Windows without requiring to have a linux install.
3) plug your device into the Windows machine you want to image. If it is only for one machine, good-to-go. If you are trying to create a 'gold image' for distributing to multiple machines at once, look into 'sysprep' and other tools to prepare the windows install.
4) reboot your machine, and use your bios to choose the alternate start location. If you do not see your device, some of the USB3.0 ports/devices are not recognizable as bootable locations, so plug into a usb2.0 port to be sure.
5) the provided directions with clonezilla were excellent! If you want to review beforehand, you can check their site. Create the image, store it in the large partition, takes about 40min (minimal windows install) to create image then do a double check.
That is all for tonight, more updates later.....
Sunday, May 27, 2012
Pre-installed linux laptops
Looking around for pre-installed linux laptops. Although one can install it themselves, there is some time-savings around dealing with laptop components/linux driver support.
My particular need is for a Xen/Virtual style environment for many 'servers' for development/research. With that in mind, here is what I have been looking for:
11"-14" primarily, 15" if they have 9-cell longer battery life, but I've only seen 9-cell on 17" thus far (and do not want that big a laptop).
i7 CPU (or similar AMD, just have not seen many in laptops nowadays)
16GB ram, if 32GB ram option via 4 sodimm slots, great!
750GB/7200 rpm harddrive. No SSD. No Hybrid. no 5400rpms. If larger, great.
Lan port + wireless N built in
VGA/HDMI/similar video output for demo's/etc.
And, based on current pricing, ~$1000.
And, preferably Fedora or CentOS Dom0/Host OS that is full OS (xwindows, Eclipse IDE, etc support), with Xen VM support for guest OS's. Ubuntu/others if that is the only option, but would prefer Fedora/CentOS.
So far, I found only a handful of companies that seem reasonably able to handle these kinds of requirements:
http://zareason.com/ - has fedora support, and laptops within the above configuration range.
https://www.system76.com - best 'known' linux laptop, only ubuntu.
Still reviewing my options!
Monday, February 27, 2012
nosql/mongodb and experienced developers
Below is a great comedy with good technical and farmer references, since I grew up on a farm.
I'm not biased against any nosql db's, but it also isn't the silver bullet to anything and jumping straight to it would be futile without good experience with what you are doing....pretty much exactly what the other person is talking about :-)
Thanks my close friend at http://www.rentageekme.com for sharing!
http://www.xtranormal.com/watch/6995033/mongo-db-is-web-scale
I'm not biased against any nosql db's, but it also isn't the silver bullet to anything and jumping straight to it would be futile without good experience with what you are doing....pretty much exactly what the other person is talking about :-)
Thanks my close friend at http://www.rentageekme.com for sharing!
http://www.xtranormal.com/watch/6995033/mongo-db-is-web-scale
Thursday, December 08, 2011
Document Capture and Tables/Tabular/Invoices (ocr)
One of the roles I fulfill is working heavily in Data, or Document, Capture.
This covers a wide range:
Document Capture (or Document Content Management/Records Management as the modern term) - Index a couple of fields to be able to search/retrieve the image/document later. The second part is where you store, search, retrieve after the indexes have been captured, but that's for another time and not the focus here.
Data Capture - Collect information from paperwork for use by systems. The original image/document is not relevant after capture except as a reference. Usually unstructured documents or low volume documents.
Forms Processing - Collect information from paperwork in a fast, repeatable process. The original image/document is not relevant after capture except as a reference. Forms processing is an advanced form of Data Capture where if you have consistent forms (structured documents) where the data elements are always in the same location on the form and there is (practically) no variance in the forms/data locations.
Back to the topic at hand - Tabular Capture, or being able to OCR and Key information that is in table format from images that may have come from output systems, scanning, faxing, or other means and trying to turn it BACK into data.
How do we obtain information from tables on paper?
Forms Processing - one answer, zones. Form Processing is designed to collect information from data points on the image/document where the data element is always in the same position. If the first column/first row of a table is always 5" from the top, 1.35" from the left side, has a width of 2" and a height of 1", you zone that area. By zoning, OCR knows where to go exactly for the information, and can be tuned in how it reads the elements (I only expect numeric values here, so there will be no lowercase-L or Oh's or upper case I's or Z's). Also, by zoning, manual entry becomes easy as well as they can look directly at the location. And then exporting, hey, you already know the context of the data element because it was in a specific location, so you already know it is row 1/column 1 to put it in the right location for your export.
Phew.....lots of good stuff with Zones, or sometimes called 'Zonal OCR'. And you don't even need OCR to use zones. Downside? Lot of time in setup and tuning. Lots of time. And you need the right tools in your capture suite to support it. And again, it doesn't even have to use OCR, just setting up zones for manual capture and your export is a gain.
So...what happens when the paperwork has tables but the paperwork is sporadic, non-consistent, unstructured, and may have a high rate of change you not only have no control over, but no upfront notification of the changes? Examples you ask -- Invoices are the biggest culprit, but there are many others out there.
Answer? Well....this is where some companies have innovative approaches to the problem, but from my point of view nothing has been great yet. The column locations are likely different between tables (i.e. first column on one invoice is the product ID, another it is the description, yet another invoice it is the quantity). Some approaches to using regular expressions (regex in shorthand) to detect the context of the data have been tried, but a unit price, calculated price, discount price, and total price all look the same and again could be shuffled around column-wise depending on the invoice. Others have some basic attempts at image analysis to do table detection, and try to OCR the headers for context of the columns (but, running into the problem that invoices have different column header names for the same semantic meaning, while in others the headers have inverse-coloring (white text on black background)))...of all, this is probably the best automation approach but is very immature at the moment.
All good attempts to automate the unstructured tabular capture problem, and maybe in controlled scenarios they work great. But in the real world, lets face it - a human being will need to help figure out how the table is structured and the context of the data elements so it can be captured appropriately (whether OCR or manual again doesn't matter), but done in such a way to be efficient and productive.
Posting here if anyone has found anything, if not, if you stumbled on this blog in a hope to solve this specific problem -- at least you are not alone!
This covers a wide range:
Document Capture (or Document Content Management/Records Management as the modern term) - Index a couple of fields to be able to search/retrieve the image/document later. The second part is where you store, search, retrieve after the indexes have been captured, but that's for another time and not the focus here.
Data Capture - Collect information from paperwork for use by systems. The original image/document is not relevant after capture except as a reference. Usually unstructured documents or low volume documents.
Forms Processing - Collect information from paperwork in a fast, repeatable process. The original image/document is not relevant after capture except as a reference. Forms processing is an advanced form of Data Capture where if you have consistent forms (structured documents) where the data elements are always in the same location on the form and there is (practically) no variance in the forms/data locations.
Back to the topic at hand - Tabular Capture, or being able to OCR and Key information that is in table format from images that may have come from output systems, scanning, faxing, or other means and trying to turn it BACK into data.
How do we obtain information from tables on paper?
Forms Processing - one answer, zones. Form Processing is designed to collect information from data points on the image/document where the data element is always in the same position. If the first column/first row of a table is always 5" from the top, 1.35" from the left side, has a width of 2" and a height of 1", you zone that area. By zoning, OCR knows where to go exactly for the information, and can be tuned in how it reads the elements (I only expect numeric values here, so there will be no lowercase-L or Oh's or upper case I's or Z's). Also, by zoning, manual entry becomes easy as well as they can look directly at the location. And then exporting, hey, you already know the context of the data element because it was in a specific location, so you already know it is row 1/column 1 to put it in the right location for your export.
Phew.....lots of good stuff with Zones, or sometimes called 'Zonal OCR'. And you don't even need OCR to use zones. Downside? Lot of time in setup and tuning. Lots of time. And you need the right tools in your capture suite to support it. And again, it doesn't even have to use OCR, just setting up zones for manual capture and your export is a gain.
So...what happens when the paperwork has tables but the paperwork is sporadic, non-consistent, unstructured, and may have a high rate of change you not only have no control over, but no upfront notification of the changes? Examples you ask -- Invoices are the biggest culprit, but there are many others out there.
Answer? Well....this is where some companies have innovative approaches to the problem, but from my point of view nothing has been great yet. The column locations are likely different between tables (i.e. first column on one invoice is the product ID, another it is the description, yet another invoice it is the quantity). Some approaches to using regular expressions (regex in shorthand) to detect the context of the data have been tried, but a unit price, calculated price, discount price, and total price all look the same and again could be shuffled around column-wise depending on the invoice. Others have some basic attempts at image analysis to do table detection, and try to OCR the headers for context of the columns (but, running into the problem that invoices have different column header names for the same semantic meaning, while in others the headers have inverse-coloring (white text on black background)))...of all, this is probably the best automation approach but is very immature at the moment.
All good attempts to automate the unstructured tabular capture problem, and maybe in controlled scenarios they work great. But in the real world, lets face it - a human being will need to help figure out how the table is structured and the context of the data elements so it can be captured appropriately (whether OCR or manual again doesn't matter), but done in such a way to be efficient and productive.
Posting here if anyone has found anything, if not, if you stumbled on this blog in a hope to solve this specific problem -- at least you are not alone!
Sunday, December 04, 2011
JavaEE 6 app servers compared
Thank you Antonio!
Baseline/platform sizing of different JavaEE containers (disk, ram, startup).
http://agoncal.wordpress.com/2011/10/20/o-java-ee-6-application-servers-where-art-thou/
The more complex metrics of scalability (cpu/mem increase as add more load), performance (first-call as well as high concurrency), and cluster/ha require constants on the OS/hardware/VM/JVM that takes quite a bit more setup and time. At least the above are relatively constant.
Baseline/platform sizing of different JavaEE containers (disk, ram, startup).
http://agoncal.wordpress.com/2011/10/20/o-java-ee-6-application-servers-where-art-thou/
The more complex metrics of scalability (cpu/mem increase as add more load), performance (first-call as well as high concurrency), and cluster/ha require constants on the OS/hardware/VM/JVM that takes quite a bit more setup and time. At least the above are relatively constant.
Friday, June 03, 2011
hypervisor (vm) and jvm (java) and SLA and costs
I've been testing several approaches to optimize the platform that the applications run on. This blog post is just a brain dump without any clear direction other than current thoughts.
Most of the applications I work it would fall under the equivalent of the JavaEE6 web-profile (jpa/web or jpa/ejb/web) with a couple that have messaging that, in reality, could be modified to work with other async-style approaches (while messaging also supports distributed work efforts, most of the applications aren't reaching a critical mass where then need to distribute that work).
So, what are we talking about platform wise?
*jboss or tomcat (or, more appropriately, the new TomEE as an option)
*jvm
*OS to run it on (preferably with iSCSI and similar large-disk-space mounting support).
*hypervisor to run multiple guest OS/vm/appcontainers.
Some of the general goals are reduce diskspace/memory, maximize the number of applications that can run on a piece of hardware, while still protecting or segregating applications from each-other so if in our haste to 'time to market' an application will only hurt itself and not any others. Failover/disaster-recovery is also a consideration, with a minor emphasis on time-to-increase-capacity-and-associated-downtime but that is not as critical.
App Container
Jboss has been doing some wonderful things with the new jboss7 AS stack. I haven't finished my memory review, but I hope they got the 'memory bloat' under control. Jboss 4.0.x series with one application can run in under 128MB in most cases, while Jboss 5.x and 6.x series for the SAME app need to double-to-triple to 256MB/364MB.
-jboss deployment bonus: The ability to deploy an application's 'configuration' beside it as a SAR in the same deployment directory as the application WITHOUT needing to modify the server itself is HUGE. I do not understand why people do not take more advantage of the SAR benefits. You create your application binary once, then vet/test with one SAR configuration, take the SAME binary to your staging/pre-deploy/uat/stress-testing/etc environments with different SAR configurations, then again move the SAME binary to production with a different SAR configuration. What you tested is what went live.
-And, once you setup the SAR configuration for the environment...leave it there and update the application binary with changes (assuming no additional configurations). The least variables to mess around with the better!
TomEE is a new player and haven't reviewed it yet.
Jonas unfortunately has never gave reason to peak my interest.
Geronimo & Glassfish are additional options, but also do not provide any significant reason to change from Jboss (which I have the most experience/skill in).
Tomcat/Jetty are decent web-only platforms, but would not be considered as part of the strategy related to inability to support the full necessary stacks.
Conclusion: Jboss still in the win, but if Memory is a constraint be wary of jboss5/6 versus the older jboss 4.0.x series. The new Jboss7AS is a significant rewrite and will hopefully address this, as well as additional scenarios.
jvm/os
This is where it gets interesting....
*jboss again comes out with the Boxgrinder project so that you can have predictable/repeatable platforms. This is kind of an outsider as it doesn't directly relate to any of the above areas, but is a way towards combining and using them in a cool (or more predictable...less variables) fashion.
*Azul has their new Zing JVM/OS combo-solution that will run on hypervisors (and is optimized). But, at a price of $5k-$6k per 'server', but I haven't touched/tested/or discussed if a server represents a single JVM that can run multiple appcontainers or not.
*Oracle has a not-very-discussed JVM/OS combo-solution that will also run on hypervisors called Maxine Virtual Edition: http://labs.oracle.com/projects/guestvm/
-GPL licensed/forever open sourced.
-takes queues from openJDK, so will continue to keep updated with recent JDK updates.
-not 'production' ready...if this can get some more steam, this is definately a good place to go.
Away from the cool stuff, and back to reality --
Just Enough Operating System (JEOS) continues to be a buzzword but with no real meat or applied solutions. The Boxgrinder project above does try to help with some pre-defined approaches to a JEOS for the different linux OS distributions. CentOS is still a popular choice for low-cost options, and the guys there are trying there best to get CentOS 6 out the door even while RHEL 6.1 gets released -- if you want the faster turn around, pay for it and get the benefit of testing and security announcements, otherwise free CentOS is free but help them out.
hypervisor (virtualization)
Hypervisor battle is pretty hot right now, with no real clear winner yet.
With Xen and KVM as the current front-runners on the open-source server hypervisor segment (with others close behind), it's not really black and white which one to pick although Xen has a little bit of an edge with Citrix backing and Paravirtualization support.
VMWare, hyper-v (which announced CentOS support?!), and other commercials also offering some competitive advantages over the open source alternatives (for a price).
Most of the applications I work it would fall under the equivalent of the JavaEE6 web-profile (jpa/web or jpa/ejb/web) with a couple that have messaging that, in reality, could be modified to work with other async-style approaches (while messaging also supports distributed work efforts, most of the applications aren't reaching a critical mass where then need to distribute that work).
So, what are we talking about platform wise?
*jboss or tomcat (or, more appropriately, the new TomEE as an option)
*jvm
*OS to run it on (preferably with iSCSI and similar large-disk-space mounting support).
*hypervisor to run multiple guest OS/vm/appcontainers.
Some of the general goals are reduce diskspace/memory, maximize the number of applications that can run on a piece of hardware, while still protecting or segregating applications from each-other so if in our haste to 'time to market' an application will only hurt itself and not any others. Failover/disaster-recovery is also a consideration, with a minor emphasis on time-to-increase-capacity-and-associated-downtime but that is not as critical.
App Container
Jboss has been doing some wonderful things with the new jboss7 AS stack. I haven't finished my memory review, but I hope they got the 'memory bloat' under control. Jboss 4.0.x series with one application can run in under 128MB in most cases, while Jboss 5.x and 6.x series for the SAME app need to double-to-triple to 256MB/364MB.
-jboss deployment bonus: The ability to deploy an application's 'configuration' beside it as a SAR in the same deployment directory as the application WITHOUT needing to modify the server itself is HUGE. I do not understand why people do not take more advantage of the SAR benefits. You create your application binary once, then vet/test with one SAR configuration, take the SAME binary to your staging/pre-deploy/uat/stress-testing/etc environments with different SAR configurations, then again move the SAME binary to production with a different SAR configuration. What you tested is what went live.
-And, once you setup the SAR configuration for the environment...leave it there and update the application binary with changes (assuming no additional configurations). The least variables to mess around with the better!
TomEE is a new player and haven't reviewed it yet.
Jonas unfortunately has never gave reason to peak my interest.
Geronimo & Glassfish are additional options, but also do not provide any significant reason to change from Jboss (which I have the most experience/skill in).
Tomcat/Jetty are decent web-only platforms, but would not be considered as part of the strategy related to inability to support the full necessary stacks.
Conclusion: Jboss still in the win, but if Memory is a constraint be wary of jboss5/6 versus the older jboss 4.0.x series. The new Jboss7AS is a significant rewrite and will hopefully address this, as well as additional scenarios.
jvm/os
This is where it gets interesting....
*jboss again comes out with the Boxgrinder project so that you can have predictable/repeatable platforms. This is kind of an outsider as it doesn't directly relate to any of the above areas, but is a way towards combining and using them in a cool (or more predictable...less variables) fashion.
*Azul has their new Zing JVM/OS combo-solution that will run on hypervisors (and is optimized). But, at a price of $5k-$6k per 'server', but I haven't touched/tested/or discussed if a server represents a single JVM that can run multiple appcontainers or not.
*Oracle has a not-very-discussed JVM/OS combo-solution that will also run on hypervisors called Maxine Virtual Edition: http://labs.oracle.com/projects/guestvm/
-GPL licensed/forever open sourced.
-takes queues from openJDK, so will continue to keep updated with recent JDK updates.
-not 'production' ready...if this can get some more steam, this is definately a good place to go.
Away from the cool stuff, and back to reality --
Just Enough Operating System (JEOS) continues to be a buzzword but with no real meat or applied solutions. The Boxgrinder project above does try to help with some pre-defined approaches to a JEOS for the different linux OS distributions. CentOS is still a popular choice for low-cost options, and the guys there are trying there best to get CentOS 6 out the door even while RHEL 6.1 gets released -- if you want the faster turn around, pay for it and get the benefit of testing and security announcements, otherwise free CentOS is free but help them out.
hypervisor (virtualization)
Hypervisor battle is pretty hot right now, with no real clear winner yet.
With Xen and KVM as the current front-runners on the open-source server hypervisor segment (with others close behind), it's not really black and white which one to pick although Xen has a little bit of an edge with Citrix backing and Paravirtualization support.
VMWare, hyper-v (which announced CentOS support?!), and other commercials also offering some competitive advantages over the open source alternatives (for a price).
Wednesday, May 04, 2011
Alfresco as an Image Archive Server (TIFF/fax/scan images)
Currently evaluating Alfresco CE 3.4.d for use as an Image Archive/Record Content Management Server. Definition is to store multi-page TIFF images that have 2-6 custom attributes that must be searchable to retrieve the associated images.
The most common usecase that doesn't involve company-specific attributes as an example is storing incoming Fax images where you want to store attributes such as the number dialed to come in (enterprise w/ DID or similar fax setup), date it came in, number it came from (if available). For the number dialed in, you could instead say 'Department'.
Anyway, this post isn't about the custom attributes piece, this is for the image piece.
Req 1, allow to store and view multipage TIFF images (preferably without requiring a TIFF plugin that will likely change on Office upgrades).
Alfresco by default does not handle multipage TIFF. In fact, 3.4.d the supplied ImageMagick doesn't even support TIFF (see /alfresco/common/bin 'convert -list configure', DELEGATES line, should see TIF and it isn't there). 3.4.e DOES support TIF, but only for windows and 64-bit linux, and only the *first* page of the TIF.
Luckily, this wonderful community member of the open source product Alfresco already had a solution: http://fabiostrozzi.eu/2010/10/27/improving-tiff-preview-in-alfresco-share/
With additional modifications to remove ImageMagick, OpenOffice, and other ancillary services that were not needed for something soley to be a TIFF-based Image Server, a rather slim solution that with the default 'SHARE' interface is a good solution. I do have 3.4.d working with this solution, and will be doing a more enterprise-oriented tomcat deploy opposed to the installer approach and feel quite confident in how Alfresco team architected the product to support each companies' unique needs.
Current problem: The FLASH previewer is good, but the challenge with multi-page TIFF is that the tiff2pdf conversion isn't that bad....it's the pdf2swf that is taking 1/4 to 1/2 a second per page.
Research notes for TIFF 2 PDF conversion those interested:
ImageMagick 6.5.4 seems to work, but has huge/escalating memory requirements as TIFF's grow for tiff2pdf:
Memory requirements of 600MB-3GB of system ram (non jvm heap) per image conversion (but fast, 1-4 seconds).
3GB is related to a 7mb test file that seems to have some bad TIF encoding, however
3GB is only because moved to swap space, it may be more.
instead, use a newer version:
wget ftp://ftp.imagemagick.org/pub/ImageMagick/linux/SRPMS/ImageMagick-6.6.9-7.src.rpm
sudo yum groupinstall "Development Tools"
sudo yum install rpmdevtool libtool-ltdl-devel
sudo yum install djvulibre-devel tcl-devel freetype-devel ghostscript-devel libwmf-devel jasper-devel lcms-devel bzip2-devel librsvg2 librsvg2-devel liblpr-1 liblqr-1-devel libtool-ltdl-devel autotrace-devel
rpmbuild --nodeps --rebuild ImageMagick-6.6.9-7.src.rpm
cd /home/dhartford/build/RPMS/i686
sudo rpm -ihv --force --nodeps ImageMagick-6.6.9-7.i686.rpm
In the end, same memory requirements (600MB-3GB).
Alternatives reviewed:
A separate medium has been suggested, such as TIFF to GIF, then GIF to PDF:
${img.exe} ${source} gif:- | convert gif:- ${target}
slightly better, but the edge case of 3GB ram still occurs. Also increases diskspace with additional medium.
Switches to work around potential problem areas do not seem to matter:
${img.exe} -monochrome -compress Fax ${source} ${target}
No difference.
TIFF to PNG, may get more performance from GraphicsMagick:
http://superuser.com/questions/233441/use-imagemagick-to-convert-tiff-to-pngs-how-to-improve-the-speed
--not tested
libtiff has a direct **tiff2pdf** that simply 'wraps' the image with PDF headers without
doing dpi/sizing/re-rendering like the ImageMagick/GraphicsMagic approach (which,
under the covers, uses libtiff to read the tiff then sends the resulting image
through image processing for dpi/resolution modifications and then sends it
to Ghostscript to generate the resulting PDF). Note that imagemagick and
graphicsmagick under the covers also uses libtiff anyway for TIFF decoding.
BEST OPTION from testing, tiff2pdf modification testing seems to be around:
Memory requirements of 10MB-80MB of system ram (non jvm heap) per image conversion, ~1 second fast.
--some issues around if bad TIF encoding sending to stdout/stderror, creates an exit status preventing completion in Alfresco transformer.
Asking mailing list if there is a quiet/silent mode so tries best-attempt at conversion without
causing the exit status.
There is no 3GB ram issue (instead 80MB over ~10 sec for the 7MB tiff/99 pages).
*NOTE: The 7MB example came back as 99 pages in SWF previewer. Using separate system TIFF and PDF viewers, also 99 pages, so consistent.
Research notes on the PDF viewer(s) when used with TIFF 2 pdf conversion:
http://wiki.alfresco.com/wiki/Installing_Alfresco_components#Linux_and_Unix_Installation
version 0.8.1 does not paginate tiff2pdf conversions, causing repeating cycle in the flash previewer.
NOTE: alternate viewer: http://swfviewer.blogspot.com/
REVIEWED: http://packages.sw.be/swftools/, only has rpms up to 0.8.1, and there have been several releases since then.
TODO: 64-bit centos binary: http://wiki.alfresco.com/w/images/1/1d/Swftools-centos54-x86_64.tar.gz
mkdir /opt/swftools
cd /opt/swftools
wget http://www.swftools.org/swftools-0.9.1.tar.gz
tar -xzvf swftools-0.9.1.tar.gz
yum install zlib-devel libjpeg-devel giflib-devel freetype-devel gcc gcc-c++ make
cd swftools-0.9.1
./configure --disable-lame --prefix=/opt/swftools/swftools-0.9.1-bin/
make
make install
Diskspace footprint for /opt/swftools including source code, configure, make, and binary:
46MB
The most common usecase that doesn't involve company-specific attributes as an example is storing incoming Fax images where you want to store attributes such as the number dialed to come in (enterprise w/ DID or similar fax setup), date it came in, number it came from (if available). For the number dialed in, you could instead say 'Department'.
Anyway, this post isn't about the custom attributes piece, this is for the image piece.
Req 1, allow to store and view multipage TIFF images (preferably without requiring a TIFF plugin that will likely change on Office upgrades).
Alfresco by default does not handle multipage TIFF. In fact, 3.4.d the supplied ImageMagick doesn't even support TIFF (see /alfresco/common/bin 'convert -list configure', DELEGATES line, should see TIF and it isn't there). 3.4.e DOES support TIF, but only for windows and 64-bit linux, and only the *first* page of the TIF.
Luckily, this wonderful community member of the open source product Alfresco already had a solution: http://fabiostrozzi.eu/2010/10/27/improving-tiff-preview-in-alfresco-share/
With additional modifications to remove ImageMagick, OpenOffice, and other ancillary services that were not needed for something soley to be a TIFF-based Image Server, a rather slim solution that with the default 'SHARE' interface is a good solution. I do have 3.4.d working with this solution, and will be doing a more enterprise-oriented tomcat deploy opposed to the installer approach and feel quite confident in how Alfresco team architected the product to support each companies' unique needs.
Current problem: The FLASH previewer is good, but the challenge with multi-page TIFF is that the tiff2pdf conversion isn't that bad....it's the pdf2swf that is taking 1/4 to 1/2 a second per page.
Research notes for TIFF 2 PDF conversion those interested:
ImageMagick 6.5.4 seems to work, but has huge/escalating memory requirements as TIFF's grow for tiff2pdf:
Memory requirements of 600MB-3GB of system ram (non jvm heap) per image conversion (but fast, 1-4 seconds).
3GB is related to a 7mb test file that seems to have some bad TIF encoding, however
3GB is only because moved to swap space, it may be more.
instead, use a newer version:
wget ftp://ftp.imagemagick.org/pub/ImageMagick/linux/SRPMS/ImageMagick-6.6.9-7.src.rpm
sudo yum groupinstall "Development Tools"
sudo yum install rpmdevtool libtool-ltdl-devel
sudo yum install djvulibre-devel tcl-devel freetype-devel ghostscript-devel libwmf-devel jasper-devel lcms-devel bzip2-devel librsvg2 librsvg2-devel liblpr-1 liblqr-1-devel libtool-ltdl-devel autotrace-devel
rpmbuild --nodeps --rebuild ImageMagick-6.6.9-7.src.rpm
cd /home/dhartford/build/RPMS/i686
sudo rpm -ihv --force --nodeps ImageMagick-6.6.9-7.i686.rpm
In the end, same memory requirements (600MB-3GB).
Alternatives reviewed:
A separate medium has been suggested, such as TIFF to GIF, then GIF to PDF:
slightly better, but the edge case of 3GB ram still occurs. Also increases diskspace with additional medium.
Switches to work around potential problem areas do not seem to matter:
No difference.
TIFF to PNG, may get more performance from GraphicsMagick:
http://superuser.com/questions/233441/use-imagemagick-to-convert-tiff-to-pngs-how-to-improve-the-speed
--not tested
libtiff has a direct **tiff2pdf** that simply 'wraps' the image with PDF headers without
doing dpi/sizing/re-rendering like the ImageMagick/GraphicsMagic approach (which,
under the covers, uses libtiff to read the tiff then sends the resulting image
through image processing for dpi/resolution modifications and then sends it
to Ghostscript to generate the resulting PDF). Note that imagemagick and
graphicsmagick under the covers also uses libtiff anyway for TIFF decoding.
BEST OPTION from testing, tiff2pdf modification testing seems to be around:
Memory requirements of 10MB-80MB of system ram (non jvm heap) per image conversion, ~1 second fast.
--some issues around if bad TIF encoding sending to stdout/stderror, creates an exit status preventing completion in Alfresco transformer.
Asking mailing list if there is a quiet/silent mode so tries best-attempt at conversion without
causing the exit status.
There is no 3GB ram issue (instead 80MB over ~10 sec for the 7MB tiff/99 pages).
*NOTE: The 7MB example came back as 99 pages in SWF previewer. Using separate system TIFF and PDF viewers, also 99 pages, so consistent.
Research notes on the PDF viewer(s) when used with TIFF 2 pdf conversion:
http://wiki.alfresco.com/wiki/Installing_Alfresco_components#Linux_and_Unix_Installation
version 0.8.1 does not paginate tiff2pdf conversions, causing repeating cycle in the flash previewer.
NOTE: alternate viewer: http://swfviewer.blogspot.com/
REVIEWED: http://packages.sw.be/swftools/, only has rpms up to 0.8.1, and there have been several releases since then.
TODO: 64-bit centos binary: http://wiki.alfresco.com/w/images/1/1d/Swftools-centos54-x86_64.tar.gz
mkdir /opt/swftools
cd /opt/swftools
wget http://www.swftools.org/swftools-0.9.1.tar.gz
tar -xzvf swftools-0.9.1.tar.gz
yum install zlib-devel libjpeg-devel giflib-devel freetype-devel gcc gcc-c++ make
cd swftools-0.9.1
./configure --disable-lame --prefix=/opt/swftools/swftools-0.9.1-bin/
make
make install
Diskspace footprint for /opt/swftools including source code, configure, make, and binary:
46MB
Tuesday, February 15, 2011
Javamelody performance & usage statistics
One of the hidden gems in the open source world is a project called Javamelody.
I've been using this since late 2009 to help refactor/modify design and code based on usage-based findings. It is not a profiler, not a click-n-fix, not a quickly-fix-your-problems tool. It is a tool to get you the information, over time, that you need to make Strategic decisions about design/code.
http://code.google.com/p/javamelody/
It gets all tiers of statistics within a single application -> the application's UI calls, business (ejb/facade/spring) calls, and sql calls.
Recently I finally submitted a patch for GWT-RPC detailed statistics I've been using for a while to help, again from a strategic point of view, refine some products.
Enjoy!
I've been using this since late 2009 to help refactor/modify design and code based on usage-based findings. It is not a profiler, not a click-n-fix, not a quickly-fix-your-problems tool. It is a tool to get you the information, over time, that you need to make Strategic decisions about design/code.
http://code.google.com/p/javamelody/
It gets all tiers of statistics within a single application -> the application's UI calls, business (ejb/facade/spring) calls, and sql calls.
Recently I finally submitted a patch for GWT-RPC detailed statistics I've been using for a while to help, again from a strategic point of view, refine some products.
Enjoy!
Monday, January 24, 2011
Web UI upgradability
One of the areas that has been an issue over time is taking an application, say deployed to jboss 3.0 or 3.2.3, and try to upgrade it to jboss 4.0.5. Or tomcat 4 to tomcat 5. Or any upgrades at all.
Real-world experience with struts (1.0/1.1)/JSP sites have several challenges in upgrading. Whether they are container based or implementation base, I have never had success with 'easy' upgrades.
JSF appears to have similar issues. I myself kept running into performance issues everytime I've attempted a JSF implementation, so relying on this post to confirm similar issues: http://jsfunit.blogspot.com/2010/12/jsf-on-jboss-as6-final.html
Now, onto one known savior - GWT is upgrade compatible. I have successfully upgraded 1.3 to 1.5, 1.5 to 2.0, 2.0 to 2.1, and 1.3 to 2.0 (I haven't tried direct to 2.1). The only upgrade issues were 1.3 to higher versions dealing with RPC changes.
Real-world experience with struts (1.0/1.1)/JSP sites have several challenges in upgrading. Whether they are container based or implementation base, I have never had success with 'easy' upgrades.
JSF appears to have similar issues. I myself kept running into performance issues everytime I've attempted a JSF implementation, so relying on this post to confirm similar issues: http://jsfunit.blogspot.com/2010/12/jsf-on-jboss-as6-final.html
Now, onto one known savior - GWT is upgrade compatible. I have successfully upgraded 1.3 to 1.5, 1.5 to 2.0, 2.0 to 2.1, and 1.3 to 2.0 (I haven't tried direct to 2.1). The only upgrade issues were 1.3 to higher versions dealing with RPC changes.
Monday, January 17, 2011
Testing GWT-RPC, and why to be careful about jumping to RequestFactory
Just a copy of what I posted on StackOverflow: http://stackoverflow.com/questions/4119867/when-should-i-use-requestfactory-vs-gwt-rpc/4714437#4714437
The only caveat I would put in is that RequestFactory uses the binary data transport (deRPC maybe?) and not the normal GWT-RPC.
This only matters if you are doing heavy testing with SyncProxy, Jmeter, Fiddler, or any similar tool that can read/evaluate the contents of the HTTP request/response (like GWT-RPC), but would be more challenging with deRPC or RequestFactory.
The only caveat I would put in is that RequestFactory uses the binary data transport (deRPC maybe?) and not the normal GWT-RPC.
This only matters if you are doing heavy testing with SyncProxy, Jmeter, Fiddler, or any similar tool that can read/evaluate the contents of the HTTP request/response (like GWT-RPC), but would be more challenging with deRPC or RequestFactory.
Monday, August 23, 2010
openEJB unit testing for jboss deploys
Some notes using mavenized /src/main/resources/META-INF/openejb-jar.xml:
<openejb-jar>
<!-- make backward compatible with jboss style deployments. For EAR deploys prefix the .format = EARname/{deploymentId} -->
<properties>
openejb.deploymentId.format = {ejbName}
openejb.jndiname.format = {deploymentId}/{interfaceType.annotationNameLC}
</properties>
</openejb-jar>
<openejb-jar>
<!-- make backward compatible with jboss style deployments. For EAR deploys prefix the .format = EARname/{deploymentId} -->
<properties>
openejb.deploymentId.format = {ejbName}
openejb.jndiname.format = {deploymentId}/{interfaceType.annotationNameLC}
</properties>
</openejb-jar>
Monday, August 09, 2010
Eclipse JPA tooling, Hibernate (jboss) tooling
Working on ways to improve the tooling/work environment when in a JPA project.
In the past, pretty much hand-code everything and rely on maven/unit-tests to catch errors.
Quicknote experiences:
* To get JPA Tooling working, need to map the jdbc driver manually/directly to the filesystem jar location through the Eclipse->DataManagement features.
* More on JPA tooling, particularly with maven layout, here: http://www.eclipse.org/forums/index.php?t=msg&goto=508143
* To get Hibernate Tooling working, need to add the jdbc driver to the classpath, EVEN IF you are using Database Connection:JPA project configured option (i.e. see above direct jar filesystem mapping does not carry over to Hibernate Tooling).
* In the persistence.xml, to avoid dealing with a lot of issues, remove JTA requirements. This works for me as the Entity class/domain are in a project seperate from the Session Bean (the Entity Managers), so the Entity class/domain has a non-JTA persistence.xml, while the Session Bean (entity manager) project has a JTA persistence.xml. I hate inconsistencies, but only way this seems to work.
Gains:
* In JPA tooling, immediately checked the model to the database structure, and identified a couple of case-sensitivity issues between the field name and the column name that were easy to fix.
* In Hibernate tooling, can test-run jpa-ql queries to see if they work as expected, timing, and review results. Can also look at the Dynamic SQL Preview to see the actual sql used for future index optimizations.
In the past, pretty much hand-code everything and rely on maven/unit-tests to catch errors.
Quicknote experiences:
* To get JPA Tooling working, need to map the jdbc driver manually/directly to the filesystem jar location through the Eclipse->DataManagement features.
* More on JPA tooling, particularly with maven layout, here: http://www.eclipse.org/forums/index.php?t=msg&goto=508143
* To get Hibernate Tooling working, need to add the jdbc driver to the classpath, EVEN IF you are using Database Connection:JPA project configured option (i.e. see above direct jar filesystem mapping does not carry over to Hibernate Tooling).
* In the persistence.xml, to avoid dealing with a lot of issues, remove JTA requirements. This works for me as the Entity class/domain are in a project seperate from the Session Bean (the Entity Managers), so the Entity class/domain has a non-JTA persistence.xml, while the Session Bean (entity manager) project has a JTA persistence.xml. I hate inconsistencies, but only way this seems to work.
Gains:
* In JPA tooling, immediately checked the model to the database structure, and identified a couple of case-sensitivity issues between the field name and the column name that were easy to fix.
* In Hibernate tooling, can test-run jpa-ql queries to see if they work as expected, timing, and review results. Can also look at the Dynamic SQL Preview to see the actual sql used for future index optimizations.
Monday, July 26, 2010
(CI) Building Eclipse PDE plugins from Maven
...is a pain in the arse.
After evaluating maven-pde-plugin, which one would think would make it easy, turns out not so much.
I've swapped over to using Tycho (because it appears to better support multiple build options, like update sites and RCP apps directly instead of just plugins and features), but that isn't proving trivial even in the most basic sense still.
But, using Tycho 0.9.0 from the ibiblio org.sonatype.tycho groupid (not to be confused with org.codehaus.tycho...or several other groupId's I've run into) you still have issues:
Errors like: "Cannot find lifecycle mapping for packing: 'eclipse-plugin' come up a lot. Looking at the off-chance there is a dependency issue, you are required to use an unstable release version of Maven 3 (as of 7/26/2010 at any rate). Using maven 3.0-beta-1 you now get "Unknown packaging: eclipse-plugin"...so not much help there either.
Searching for help on either of these issues get posts like 'fixed in Tycho 0.5.0', or 'you need to modify how you build from source'...which if you get the binary from a public maven repository one would hope would work as expected (per why most people want to use maven so you DONT run into these issues).
Other people mention 'update m2eclipse'...except I'm running this from the command line for the purpose of eventually moving to Hudson/Continuous Integration. Maybe I mis-understand the purpose of this maven plugin and it must be used in eclipse with m2e?
Please help if you read this!
EDIT: reason for chasing down why I want to automate Eclipse PDE builds is
1) I have an RCP app I would like to migrate over (from Eclipse 3.0 unfortunately)
2) primary reason was to pre-load company JDBC drivers for use in Eclipse (http://www.eclipse.org/forums/index.php?t=msg&goto=549384)
ANSWER: do not assume the 'convention':
WRONG plugin artifactId: maven-tycho-plugin
CORRECT plugin artifactId: tycho-maven-pluginWednesday, July 21, 2010
Web Browser plugins, how I loathe thee, let me count the ways.....
I have had a passionate dislike for web browser plugins. Yes, they add new exciting features...that you may or may not be able to control, or have a predictable behavior across the world-wide-web.
Take for example two very common plugins that I usually have to deal with for reporting, document management/archive, etc.
PDF plugins (Adobe)
TIFF plugins (variety)
Adobe PDF plugins -
- Versions/upgrades regularly, users have to regular update 'the site', even though it's not the site, it is the plugin asking for upgrades.
- To embed, not embed, dealing with pop-ups allowed.
- And...here is a good one....the web-embed adobe plugin making *multiple* http requests for the same content, and if your logging didn't account for that - multiple logs (see http 206, byte serving/byte range requests).
TIFF plugins -
- Variety of plugins with different options/features/control (and even something 'simple' like if the plugin allows multiple page viewing....apparently not standard?!)
- You, your client/customer, or someone, has Outlook/Office installed and it has an update, a critical update, a security update, whatever -- and reverts to using the MS Tiff viewer by default despite your best effort to use a different TIFF plugin.
- TIFF encoding/compression formats (i.e. g3/fax compression that has an X-Y ratio difference, that some plugins understand and show 'correctly', and others that show without the appropriate ratio and have 'crunched' images).
- And the occasional TIFF that has a byte that isn't understood by Plugin XYZ, or other plugin, but yes on this plugin....search for it, they happen.
Then you add in other plugins like flash/shockwave, java applets, activex/silverlight, codec/encoding video players (whether to use quicktime, realplayer, windows media player, divx, ......), and developers just can not wait until HTML 5 becomes a real-world/real-usage deal.
Subscribe to:
Posts (Atom)