gedi-geode-extensions-core/src/main/java/gedi/solutions/geode/operations/functions/GfdExportFunction.java
protected boolean  exportRegion(Region<Object, Object> region)
	{	
		if(region  == null)
			return false;
		
		if(PartitionRegionHelper.isPartitionedRegion(region))
		{
			region = PartitionRegionHelper.getLocalData(region);
		}
		
		Logger logger = LogManager.getLogger(getClass());
		
		logger.info("Exporting region"+region.getName());
		
		//get name
	    String regionName = region.getName();
	    
		File resultFile = DataOpsSecretary.determineFile(ExportFileType.gfd, regionName);
		
		//delete previous
		logger.info("deleting file:"+resultFile.getAbsolutePath());
		boolean wasDeleted = resultFile.delete();
		
		logger.info("delete:"+wasDeleted);
		
	    try
		{
			//write data
	    	RegionSnapshotService<?,?> regionSnapshotService = region.getSnapshotService();
	    	SnapshotOptionsImpl<?,?> options = (SnapshotOptionsImpl<?,?>) regionSnapshotService.createOptions();
	    	
	    	//setting parallelMode=true will cause only the local region data to export
	    	options.setParallelMode(true);
	    	regionSnapshotService.save(resultFile, SnapshotFormat.GEMFIRE);
	    	    
			return true;
			
		}
		catch (RuntimeException e)
		{
			throw e;
		}
	    catch(Exception e)
	    {
	    	throw new FunctionException("Error exporting ERROR:"+ e.getMessage()+" "+Debugger.stackTrace(e));
	    }
	}
protected boolean  exportRegion(Region<Object, Object> region)
	{	
		if(region  == null)
			return false;
		
		if(PartitionRegionHelper.isPartitionedRegion(region))
		{
			region = PartitionRegionHelper.getLocalData(region);
		}
		
		Logger logger = LogManager.getLogger(getClass());
		
		logger.info("Exporting region"+region.getName());
		
		//get name
	    String regionName = region.getName();
	    
		File resultFile = DataOpsSecretary.determineFile(ExportFileType.gfd, regionName);
		
		//delete previous
		logger.info("deleting file:"+resultFile.getAbsolutePath());
		boolean wasDeleted = resultFile.delete();
		
		logger.info("delete:"+wasDeleted);
		
	    try
		{
			//write data
	    	RegionSnapshotService<?,?> regionSnapshotService = region.getSnapshotService();
	    	SnapshotOptionsImpl<?,?> options = (SnapshotOptionsImpl<?,?>) regionSnapshotService.createOptions();
	    	
	    	//setting parallelMode=true will cause only the local region data to export
	    	options.setParallelMode(true);
	    	regionSnapshotService.save(resultFile, SnapshotFormat.GEMFIRE);
	    	    
			return true;
			
		}
		catch (RuntimeException e)
		{
			throw e;
		}
	    catch(Exception e)
	    {
	    	throw new FunctionException("Error exporting ERROR:"+ e.getMessage()+" "+Debugger.stackTrace(e));
	    }
	}
protected boolean exportRegion ( Region < Object , Object > region ) { if ( region == null ) return false ; if ( PartitionRegionHelper . isPartitionedRegion ( region ) ) { region = PartitionRegionHelper . getLocalData ( region ) ; } Logger logger = LogManager . getLogger ( getClass ( ) ) ; logger . info ( "Exporting region" + region . getName ( ) ) ; //get name
 String regionName = region . getName ( ) ; File resultFile = DataOpsSecretary . determineFile ( ExportFileType . gfd , regionName ) ; //delete previous
 logger . info ( "deleting file:" + resultFile . getAbsolutePath ( ) ) ; boolean wasDeleted = resultFile . delete ( ) ; logger . info ( "delete:" + wasDeleted ) ; try { //write data
 RegionSnapshotService < ? , ? > regionSnapshotService = region . getSnapshotService ( ) ; SnapshotOptionsImpl < ? , ? > options = ( SnapshotOptionsImpl < ? , ? > ) regionSnapshotService . createOptions ( ) ; //setting parallelMode=true will cause only the local region data to export
 options . setParallelMode ( true ) ; regionSnapshotService . save ( resultFile , SnapshotFormat . GEMFIRE ) ; return true ; } catch ( RuntimeException e ) { throw e ; } catch ( Exception e ) { throw new FunctionException ( "Error exporting ERROR:" + e . getMessage ( ) + " " + Debugger . stackTrace ( e ) ) ; } }
------------------------------------------------
------------------------------------------------