gedi-geode-extensions-core/src/main/java/gedi/solutions/geode/operations/gfd/SplitGfdFile.java
@Override
	public void run()
	{
		if (!outDirectory.exists())
		{
			throw new IllegalArgumentException(outDirectory + " does not exist");
		}

		// read

		try(SnapshotRecordReader reader = new SnapshotRecordReader(inFile))
		{
			
			SnapshotRecord record = null;

			// create writer
			int batchCount = 1;
			File out = createFile(batchCount++);
			SnapshotRecordWriter writer = null;
			
			try
			{
				writer = new SnapshotRecordWriter(out, regionName);
				int cnt = 0;
				while ((record = reader.readSnapshotRecord()) != null)
				{
					writer.writeSnapshotEntry(record);
					cnt++;
	
					if (cnt >= batchSize)
					{
						out = createFile(batchCount++);
						writer.close();
						
						writer = new SnapshotRecordWriter(out, regionName);
					}
				}
			}
			finally
			{
				if(writer != null)
					writer.close();
			}
		}
		catch (ClassNotFoundException | IOException e)
		{
			throw new RuntimeException(e.getMessage(), e);
		}
	}
@Override
	public void run()
	{
		if (!outDirectory.exists())
		{
			throw new IllegalArgumentException(outDirectory + " does not exist");
		}

		// read

		try(SnapshotRecordReader reader = new SnapshotRecordReader(inFile))
		{
			
			SnapshotRecord record = null;

			// create writer
			int batchCount = 1;
			File out = createFile(batchCount++);
			SnapshotRecordWriter writer = null;
			
			try
			{
				writer = new SnapshotRecordWriter(out, regionName);
				int cnt = 0;
				while ((record = reader.readSnapshotRecord()) != null)
				{
					writer.writeSnapshotEntry(record);
					cnt++;
	
					if (cnt >= batchSize)
					{
						out = createFile(batchCount++);
						writer.close();
						
						writer = new SnapshotRecordWriter(out, regionName);
					}
				}
			}
			finally
			{
				if(writer != null)
					writer.close();
			}
		}
		catch (ClassNotFoundException | IOException e)
		{
			throw new RuntimeException(e.getMessage(), e);
		}
	}
@ Override public void run ( ) { if ( ! outDirectory . exists ( ) ) { throw new IllegalArgumentException ( outDirectory + " does not exist" ) ; } // read try ( SnapshotRecordReader reader = new SnapshotRecordReader ( inFile ) ) { SnapshotRecord record = null ; // create writer int batchCount = 1 ; File out = createFile ( batchCount ++ ) ; SnapshotRecordWriter writer = null ; try { writer = new SnapshotRecordWriter ( out , regionName ) ; int cnt = 0 ; while ( ( record = reader . readSnapshotRecord ( ) ) != null ) { writer . writeSnapshotEntry ( record ) ; cnt ++ ; if ( cnt >= batchSize ) { out = createFile ( batchCount ++ ) ; writer . close ( ) ; writer = new SnapshotRecordWriter ( out , regionName ) ; } } } finally { if ( writer != null ) writer . close ( ) ; } } catch ( ClassNotFoundException | IOException e ) { throw new RuntimeException ( e . getMessage ( ) , e ) ; } }
------------------------------------------------
------------------------------------------------