cloudera/crunch — pull request #31 by tzolov (2012-05-25 21:34:21+00:00)
Title: Resolve an exception on getSize for existing but empty PCollection

The getSize() and materialize() throw exception if the collection is created from Existing but Empty file. For example:
```Java
PCollection data = pipeline.readTextFile(nonEmptyInputPath);
PCollection emptyPCollection = data.filter(new FalseFilterFn());
emptyPCollection.write(sequenceFile(outputPath, strings()));
pipeline.readTextFile(outputPath).getSize() -> Exception!!!
```
The PCollectionGetSizeTest.java illustrates the issue

To solve it i have modified the SourceTargetHelper.getPathSize() to return (-1) on non-existing files (use to be 0)! This allows client apps to distinct the empty (e.g. size 0) from non-existing files (size =-1) - used by InputCollection.getSizeInternal() to throw an exception only on non-existing files.
Note that FileSystem.listStatus(..) returns an empty (not null) array instead on non-existing file. (e.g. no exception is thrown)
Additional changes:
-	InputCollection.getSizeInternal() returns ISE in case of negative size (e.g. -1)
-	CompositePathIterable.create() - throws exception on non-existing files.
-	FileSourceImpl.getSize() - re-throws any IOE as ISE (use to return 1L instead)

It will be nice if someone can review those changes to ensure that the approach make sense