Java Code Examples for java.io.IOException#getLocalizedMessage()

The following examples show how to use java.io.IOException#getLocalizedMessage() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DockerEnvironmentBackupManager.java    From codenvy with Eclipse Public License 1.0 6 votes vote down vote up
/**
 * Copy files of workspace into backup storage and cleanup them in container.
 *
 * @param workspaceId id of workspace to backup
 * @param containerId id of container that contains data
 * @param nodeHost host of a node where container is running
 * @throws EnvironmentException if backup failed due to abnormal state of machines in environment
 * @throws ServerException if any other error occurs
 */
public void backupWorkspaceAndCleanup(String workspaceId, String containerId, String nodeHost)
    throws ServerException, EnvironmentException {
  try {
    String destPath =
        workspaceIdHashLocationFinder.calculateDirPath(backupsRootDir, workspaceId).toString();
    // if sync agent is not in machine port parameter is not used
    int syncPort = getSyncPort(containerId);
    String srcUserName = getUserInfo(workspaceId, containerId).name;

    backupAndCleanupInsideLock(
        workspaceId, projectFolderPath, nodeHost, syncPort, srcUserName, destPath);
  } catch (IOException e) {
    throw new ServerException(e.getLocalizedMessage(), e);
  } finally {
    // remove lock in case exception prevent removing it in regular place to prevent resources
    // leak
    // and blocking further WS start
    workspacesBackupLocks.remove(workspaceId);
    // clear user info cache
    workspacesMachinesUsersInfo.remove(workspaceId);
  }
}
 
Example 2
Source File: ReportExecutor.java    From birt with Eclipse Public License 1.0 6 votes vote down vote up
public ReportExecutor( ExecutionContext context ) throws BirtException
{

	try
	{
		int version = getVersion( context.getReportDocument( ) );
		switch ( version )
		{
			case EXECUTOR_VERSION_3 :
				executor = new ReportExecutorV3( context );
				break;
			case EXECUTOR_VERSION_4 :
				executor = new ReportExecutorV3( context );
				break;
			default :
				throw new EngineException( MessageConstants.UNSUPPORTED_DOCUMENT_VERSION_ERROR
						, version );
		}
	}
	catch ( IOException ex )
	{
		throw new EngineException( ex.getLocalizedMessage( ), ex );
	}
}
 
Example 3
Source File: CubeController.java    From kylin with Apache License 2.0 6 votes vote down vote up
/**
 * Force rebuild a cube's lookup table snapshot
 *
 * @throws IOException
 */
@RequestMapping(value = "/{cubeName}/refresh_lookup", method = { RequestMethod.PUT }, produces = {
        "application/json" })
@ResponseBody
public JobInstance rebuildLookupSnapshot(@PathVariable String cubeName,
        @RequestBody LookupSnapshotBuildRequest request) {
    try {
        final CubeManager cubeMgr = cubeService.getCubeManager();
        final CubeInstance cube = cubeMgr.getCube(cubeName);
        String submitter = SecurityContextHolder.getContext().getAuthentication().getName();
        return jobService.submitLookupSnapshotJob(cube, request.getLookupTableName(), request.getSegmentIDs(),
                submitter);
    } catch (IOException e) {
        logger.error(e.getLocalizedMessage(), e);
        throw new InternalErrorException(e.getLocalizedMessage(), e);
    }
}
 
Example 4
Source File: TechServiceBean.java    From development with Apache License 2.0 6 votes vote down vote up
/**
 * Import an XML file with technical service definitions
 * 
 * @return the logical outcome.
 * @throws SaaSApplicationException
 *             Thrown from the business logic.
 */
public String xmlImport() throws SaaSApplicationException {
    
    if (PartHandler.isEmpty(uploadedFile)) {
        addMessage(null, FacesMessage.SEVERITY_ERROR, ERROR_EMPTY_FILE);
        return OUTCOME_ERROR;
    }
    
    try {          
        byte[] buffer = PartHandler.getBuffer(uploadedFile);
        getProvisioningService().importTechnicalServices(buffer);

        selectedTechnicalService = null;
        technicalServices = null;
        addMessage(null, FacesMessage.SEVERITY_INFO,
                INFO_TECH_SERVICE_IMPORTED);
    } catch (IOException e) {
        ImportException ex = new ImportException(e.getLocalizedMessage());
        logger.logError(Log4jLogger.SYSTEM_LOG, ex,
                LogMessageIdentifier.ERROR_IMPORT_XML_FAILED);
        throw ex;
    }

    return OUTCOME_SUCCESS;
}
 
Example 5
Source File: ModelController.java    From kylin with Apache License 2.0 5 votes vote down vote up
/**
 *
 * create model
 * @throws java.io.IOException
 */
@RequestMapping(value = "", method = { RequestMethod.POST }, produces = { "application/json" })
@ResponseBody
public ModelRequest saveModelDesc(@RequestBody ModelRequest modelRequest) {
    //Update Model
    DataModelDesc modelDesc = deserializeDataModelDesc(modelRequest);
    if (modelDesc == null || StringUtils.isEmpty(modelDesc.getName())) {
        return modelRequest;
    }

    if (StringUtils.isEmpty(modelDesc.getName())) {
        logger.info("Model name should not be empty.");
        throw new BadRequestException("Model name should not be empty.");
    }
    if (!ValidateUtil.isAlphanumericUnderscore(modelDesc.getName())) {
        throw new BadRequestException(
                String.format(Locale.ROOT,
                        "Invalid model name %s, only letters, numbers and underscore supported.",
                modelDesc.getName()));
    }

    try {
        modelDesc.setUuid(RandomUtil.randomUUID().toString());
        String projectName = (null == modelRequest.getProject()) ? ProjectInstance.DEFAULT_PROJECT_NAME
                : modelRequest.getProject();

        modelService.createModelDesc(projectName, modelDesc);
    } catch (IOException e) {
        // TODO Auto-generated catch block
        logger.error("Failed to deal with the request:" + e.getLocalizedMessage(), e);
        throw new InternalErrorException("Failed to deal with the request: " + e.getLocalizedMessage(), e);
    }

    modelRequest.setUuid(modelDesc.getUuid());
    modelRequest.setSuccessful(true);
    return modelRequest;
}
 
Example 6
Source File: JaxWsServiceCreator.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@Override
public void createServiceFromWsdl() throws IOException {

    //initProjectInfo(project);

    final ProgressHandle handle = ProgressHandleFactory.createHandle(NbBundle.getMessage(JaxWsServiceCreator.class, "TXT_WebServiceGeneration")); //NOI18N

    Runnable r = new Runnable() {

        @Override
        public void run() {
            try {
                handle.start(100);
                generateWsFromWsdl15(handle);
            } catch (IOException e) {
                //finish progress bar
                handle.finish();
                String message = e.getLocalizedMessage();
                if (message != null) {
                    ErrorManager.getDefault().notify(ErrorManager.INFORMATIONAL, e);
                    NotifyDescriptor nd = new NotifyDescriptor.Message(message, NotifyDescriptor.ERROR_MESSAGE);
                    DialogDisplayer.getDefault().notify(nd);
                } else {
                    ErrorManager.getDefault().notify(ErrorManager.EXCEPTION, e);
                }
            }
        }
    };
    RequestProcessor.getDefault().post(r);
}
 
Example 7
Source File: GenerateModifiedCells.java    From Llunatic with GNU General Public License v3.0 5 votes vote down vote up
public void generate(DeltaChaseStep result, String fileName) throws DAOException {
    try {
        List<String> results = generate(result);
        saveResults(results, fileName);
    } catch (IOException ex) {
        ex.printStackTrace();
        throw new DAOException(ex.getLocalizedMessage());
    }
}
 
Example 8
Source File: RestAssuredRequestMaker.java    From heat with Apache License 2.0 5 votes vote down vote up
private String getPostBodyFromQueryParams(Method httpMethod, Map<String, Object> queryParams) {
    String postBody = (String) queryParams.get(TestCaseUtils.JSON_FIELD_POST_BODY);
    try {
        postBody = HttpRequestFormatter.readPostBodyFromFile(postBody);
    } catch (FileNotFoundException fileException) {
        throw new HeatException(this.logUtils.getTestCaseDetails() + "RestAssuredMessages::executeHttpRequest --> post body file '" + postBody + "' not found!");
    } catch (IOException ioException) {
        throw new HeatException(this.logUtils.getTestCaseDetails() + "RestAssuredMessages::executeHttpRequest --> IOException message: " + ioException.getLocalizedMessage());
    } catch (Exception ex) {
        logUtils.error("({}) -- Exception in buildRequestByParams: {}", httpMethod.name(), ex.getLocalizedMessage());
    }
    return postBody;
}
 
Example 9
Source File: DtoImpl.java    From che with Eclipse Public License 2.0 5 votes vote down vote up
/** Create a textual representation of a string literal that evaluates to the given value. */
protected String quoteStringLiteral(String value) {
  StringWriter sw = new StringWriter();
  try (JsonWriter writer = new JsonWriter(sw)) {
    writer.setLenient(true);
    writer.value(value);
    writer.flush();
  } catch (IOException ex) {
    throw new RuntimeException("Unexpected I/O failure: " + ex.getLocalizedMessage(), ex);
  }
  return sw.toString();
}
 
Example 10
Source File: RpcStreamConnection.java    From p4ic4idea with Apache License 2.0 5 votes vote down vote up
/**
 * @see com.perforce.p4java.impl.mapbased.rpc.connection.RpcConnection#useConnectionCompression()
 */
@Override
public void useConnectionCompression() throws ConnectionException {
	if (!this.usingCompression) {
		super.useConnectionCompression();
		
		try {
			this.topOutputStream.flush();
			// We do this here immediately to avoid having the compress2 itself
			// compressed...
			this.putRpcPacket(RpcPacket.constructRpcPacket(
								RpcFunctionSpec.PROTOCOL_COMPRESS2,
								"compress2",
								(String[]) null, null));
			this.topOutputStream.flush();
			this.topOutputStream = new RpcGZIPOutputStream(this.outputStream);
			this.topInputStream = new RpcGZIPInputStream(this.inputStream);
		} catch (IOException exc) {
			Log.error("I/O exception encountered while setting up GZIP streaming: "
					+ exc.getLocalizedMessage());
			Log.exception(exc);
			throw new ConnectionException(
					"unable to set up client compression streaming to Perforce server: "
					+ exc.getLocalizedMessage(), exc);
		}
	}
}
 
Example 11
Source File: TableController.java    From kylin with Apache License 2.0 5 votes vote down vote up
/**
 * Get available table list of the project
 *
 * @return Table metadata array
 * @throws IOException
 */
@RequestMapping(value = "", method = { RequestMethod.GET }, produces = { "application/json" })
@ResponseBody
public List<TableDesc> getTableDesc(@RequestParam(value = "ext", required = false) boolean withExt,
        @RequestParam(value = "project", required = true) String project) throws IOException {
    try {
        return tableService.getTableDescByProject(project, withExt);
    } catch (IOException e) {
        logger.error("Failed to get Hive Tables", e);
        throw new InternalErrorException(e.getLocalizedMessage(), e);
    }
}
 
Example 12
Source File: StreamingController.java    From kylin-on-parquet-v2 with Apache License 2.0 5 votes vote down vote up
@RequestMapping(value = "/getConfig", method = { RequestMethod.GET }, produces = { "application/json" })
@ResponseBody
public List<StreamingConfig> getStreamings(@RequestParam(value = "table", required = false) String table,
        @RequestParam(value = "project", required = false) String project,
        @RequestParam(value = "limit", required = false) Integer limit,
        @RequestParam(value = "offset", required = false) Integer offset) {
    try {
        return streamingService.getStreamingConfigs(table, project, limit, offset);
    } catch (IOException e) {

        logger.error("Failed to deal with the request:" + e.getLocalizedMessage(), e);
        throw new InternalErrorException("Failed to deal with the request: " + e.getLocalizedMessage(), e);
    }
}
 
Example 13
Source File: MetaStreamReader.java    From birt with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * 
 * @param context
 * @param id
 * @throws DataException
 */
public MetaStreamReader( DataEngineContext context, StreamID id ) throws DataException
{
	try
	{
		this.streamMap = new HashMap();
		this.id = id;
		this.context = context;
		RAInputStream is = context.getInputStream( id.getStartStream( ),
				id.getSubQueryStream( ),
				DataEngineContext.META_INDEX_STREAM );
		
		DataInputStream metaIndexStream = new DataInputStream( is );
		
		
		while( is.getOffset( ) != is.length( ) )
		{
			int type = IOUtil.readInt( metaIndexStream );
			long offset = IOUtil.readLong( metaIndexStream );
			int size = IOUtil.readInt( metaIndexStream );
								
			this.streamMap.put( Integer.valueOf( type ), new OffsetInfo( offset, size ) );
		}
		
		metaIndexStream.close( );
	}
	catch ( IOException e )
	{
		throw new DataException( e.getLocalizedMessage( ) );
	}
}
 
Example 14
Source File: JavacFileManager.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Get a detail message from an IOException.
 * Most, but not all, instances of IOException provide a non-null result
 * for getLocalizedMessage().  But some instances return null: in these
 * cases, fallover to getMessage(), and if even that is null, return the
 * name of the exception itself.
 * @param e an IOException
 * @return a string to include in a compiler diagnostic
 */
public static String getMessage(IOException e) {
    String s = e.getLocalizedMessage();
    if (s != null)
        return s;
    s = e.getMessage();
    if (s != null)
        return s;
    return e.toString();
}
 
Example 15
Source File: JarPackageReader.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
/**
    * Closes this stream.
 * It is the clients responsibility to close the stream.
 *
 * @exception CoreException if closing the stream fails
    */
   public void close() throws CoreException {
   	if (fInputStream != null)
   		try {
			fInputStream.close();
   		} catch (IOException ex) {
   			String message= (ex.getLocalizedMessage() != null ? ex.getLocalizedMessage() : ""); //$NON-NLS-1$
			throw new CoreException(new Status(IStatus.ERROR, JavaPlugin.getPluginId(), IJavaStatusConstants.INTERNAL_ERROR, message, ex));
		}
}
 
Example 16
Source File: JavahTask.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
public boolean run() throws Util.Exit {

        Util util = new Util(log, diagnosticListener);

        if (noArgs || help) {
            showHelp();
            return help; // treat noArgs as an error for purposes of exit code
        }

        if (version || fullVersion) {
            showVersion(fullVersion);
            return true;
        }

        util.verbose = verbose;

        Gen g;

        if (llni)
            g = new LLNI(doubleAlign, util);
        else {
//            if (stubs)
//                throw new BadArgs("jni.no.stubs");
            g = new JNI(util);
        }

        if (ofile != null) {
            if (!(fileManager instanceof StandardJavaFileManager)) {
                diagnosticListener.report(createDiagnostic("err.cant.use.option.for.fm", "-o"));
                return false;
            }
            Iterable<? extends JavaFileObject> iter =
                    ((StandardJavaFileManager) fileManager).getJavaFileObjectsFromFiles(Collections.singleton(ofile));
            JavaFileObject fo = iter.iterator().next();
            g.setOutFile(fo);
        } else {
            if (odir != null) {
                if (!(fileManager instanceof StandardJavaFileManager)) {
                    diagnosticListener.report(createDiagnostic("err.cant.use.option.for.fm", "-d"));
                    return false;
                }

                if (!odir.exists())
                    if (!odir.mkdirs())
                        util.error("cant.create.dir", odir.toString());
                try {
                    ((StandardJavaFileManager) fileManager).setLocation(StandardLocation.CLASS_OUTPUT, Collections.singleton(odir));
                } catch (IOException e) {
                    Object msg = e.getLocalizedMessage();
                    if (msg == null) {
                        msg = e;
                    }
                    diagnosticListener.report(createDiagnostic("err.ioerror", odir, msg));
                    return false;
                }
            }
            g.setFileManager(fileManager);
        }

        /*
         * Force set to false will turn off smarts about checking file
         * content before writing.
         */
        g.setForce(force);

        if (fileManager instanceof JavahFileManager)
            ((JavahFileManager) fileManager).setSymbolFileEnabled(false);

        JavaCompiler c = ToolProvider.getSystemJavaCompiler();
        List<String> opts = new ArrayList<String>();
        opts.add("-proc:only");
        opts.addAll(javac_extras);
        CompilationTask t = c.getTask(log, fileManager, diagnosticListener, opts, classes, null);
        JavahProcessor p = new JavahProcessor(g);
        t.setProcessors(Collections.singleton(p));

        boolean ok = t.call();
        if (p.exit != null)
            throw new Util.Exit(p.exit);
        return ok;
    }
 
Example 17
Source File: ClientSystemFileCommands.java    From p4ic4idea with Apache License 2.0 4 votes vote down vote up
/**
 * Return the temp RPC output stream. If it doesn't exist, try to create a
 * new one only if the command is run from a "streamCmd" method or tracking
 * is enabled.
 */
public RpcOutputStream getTempOutputStream(CommandEnv cmdEnv)
		throws ConnectionException {
	if (cmdEnv == null) {
		throw new NullPointerError(
				"Null command env in ClientSystemFileCommands.getTempOutputStream()");
	}
	if (cmdEnv.getStateMap() == null) {
		throw new NullPointerError(
				"Null command env state map in ClientSystemFileCommands.getTempOutputStream()");
	}
	if (cmdEnv.getProtocolSpecs() == null) {
		throw new NullPointerError(
				"Null command env protocol specs in ClientSystemFileCommands.getTempOutputStream()");
	}

	RpcOutputStream outStream = (RpcOutputStream) cmdEnv.getStateMap().get(
			RpcServer.RPC_TMP_OUTFILE_STREAM_KEY);

	if (outStream == null) {
		if (cmdEnv.isStreamCmd() || cmdEnv.getProtocolSpecs().isEnableTracking()) {
			try {
				String tmpFileName = RpcPerforceFile
						.createTempFileName(RpcPropertyDefs.getProperty(
								this.server.getProperties(),
								PropertyDefs.P4JAVA_TMP_DIR_KEY,
								System.getProperty("java.io.tmpdir")));
				RpcPerforceFile tmpFile = new RpcPerforceFile(tmpFileName, RpcPerforceFileType.FST_BINARY);
				outStream = RpcOutputStream.getTmpOutputStream(tmpFile);
				// Set the new temp RPC output stream to the command env state map
				cmdEnv.getStateMap().put(RpcServer.RPC_TMP_OUTFILE_STREAM_KEY, outStream);
			} catch (IOException ioexc) {
				Log.error("tmp file creation error: " + ioexc.getLocalizedMessage());
				Log.exception(ioexc);
				throw new ConnectionException("Unable to create temporary file for Perforce file retrieval; " +
						"reason: " + ioexc.getLocalizedMessage(),
						ioexc);
			}
		}
	}

	return outStream;
}
 
Example 18
Source File: DownloadDiffAction.java    From spacewalk with GNU General Public License v2.0 4 votes vote down vote up
/**
 * {@inheritDoc}
 */
public ActionForward execute(ActionMapping mapping, ActionForm form,
        HttpServletRequest request, HttpServletResponse response) throws Exception {

    RequestContext requestContext = new RequestContext(request);

    User user = requestContext.getCurrentUser();
    Long ocrid = requestContext.getRequiredParam("ocrid");

    //Get the objects.
    ConfigFile file = ConfigActionHelper.getFile(request);
    ConfigRevision revision = ConfigActionHelper.getRevision(request, file);
    ConfigRevision other = ConfigurationManager.getInstance()
        .lookupConfigRevision(user, ocrid);

    //Get the content that we will diff.
    String[] rev = revision.getConfigContent().getContentsString().split("\n");
    String[] orev = other.getConfigContent().getContentsString().split("\n");

    Diff diff = new Diff(rev, orev);
    String charSet = response.getCharacterEncoding();
    String mimeType = "text/plain";
    response.setContentType(mimeType + ";charset=" + charSet);
    response.setHeader("Content-Disposition", "attachment; filename=rhnpatch");

    try {
        OutputStream out = response.getOutputStream();
        OutputStreamWriter writer = new OutputStreamWriter(out);
        String path = file.getConfigFileName().getPath();
        String opath = other.getConfigFile().getConfigFileName().getPath();
        Date date = revision.getCreated();
        Date odate = other.getCreated();
        writer.write(diff.patchDiff(path, opath, date, odate));
        writer.flush();
        return null;
    }
    catch (IOException ioe) {
        ActionMessages msgs = new ActionMessages();
        ActionMessage am =
            new ActionMessage("filedetails.jsp.error.download",
                    ioe.getLocalizedMessage(),
                    file.getConfigFileName().getPath());
        msgs.add(ActionMessages.GLOBAL_MESSAGE, am);
        saveMessages(request, msgs);
    }

    return getStrutsDelegate().forwardParams(mapping.findForward(
            RhnHelper.DEFAULT_FORWARD), request.getParameterMap());
}
 
Example 19
Source File: ClientSystemFileCommands.java    From p4ic4idea with Apache License 2.0 4 votes vote down vote up
/**
 * Return the temp RPC output stream. If it doesn't exist, try to create a
 * new one only if the command is run from a "streamCmd" method or tracking
 * is enabled.
 */
public RpcOutputStream getTempOutputStream(CommandEnv cmdEnv)
		throws ConnectionException {
	if (cmdEnv == null) {
		throw new NullPointerError(
				"Null command env in ClientSystemFileCommands.getTempOutputStream()");
	}
	if (cmdEnv.getStateMap() == null) {
		throw new NullPointerError(
				"Null command env state map in ClientSystemFileCommands.getTempOutputStream()");
	}
	if (cmdEnv.getProtocolSpecs() == null) {
		throw new NullPointerError(
				"Null command env protocol specs in ClientSystemFileCommands.getTempOutputStream()");
	}

	RpcOutputStream outStream = (RpcOutputStream) cmdEnv.getStateMap().get(
			RpcServer.RPC_TMP_OUTFILE_STREAM_KEY);

	if (outStream == null) {
		if (cmdEnv.isStreamCmd() || cmdEnv.getProtocolSpecs().isEnableTracking()) {
			try {
				String tmpFileName = RpcPerforceFile
						.createTempFileName(RpcPropertyDefs.getProperty(
								this.server.getProperties(),
								PropertyDefs.P4JAVA_TMP_DIR_KEY,
								System.getProperty("java.io.tmpdir")));
				RpcPerforceFile tmpFile = new RpcPerforceFile(tmpFileName, RpcPerforceFileType.FST_BINARY);
				outStream = new RpcOutputStream(tmpFile);
				// Set the new temp RPC output stream to the command env state map
				cmdEnv.getStateMap().put(RpcServer.RPC_TMP_OUTFILE_STREAM_KEY, outStream);
			} catch (IOException ioexc) {
				Log.error("tmp file creation error: " + ioexc.getLocalizedMessage());
				Log.exception(ioexc);
				throw new ConnectionException("Unable to create temporary file for Perforce file retrieval; " +
						"reason: " + ioexc.getLocalizedMessage(),
						ioexc);
			}
		}
	}

	return outStream;
}
 
Example 20
Source File: SimpleGroupCalculator.java    From birt with Eclipse Public License 1.0 4 votes vote down vote up
public void doSave( StreamManager manager ) throws DataException
{
	try {
		this.streamManager = manager;
		if (this.streamManager != null) {
			this.groupOutput = new RAOutputStream[this.groupBys.length];
			this.aggrOutput = new DataOutputStream[this.groupBys.length];
			this.aggrRAOutput = new RAOutputStream[this.groupBys.length];
			this.aggrIndexOutput = new DataOutputStream[this.groupBys.length];

			if (this.overallAggrs.size() > 0
					|| this.runningAggrs.size() > 0) {
				this.combinedAggrIndexRAOutput = (RAOutputStream) streamManager
						.getOutStream(
								DataEngineContext.COMBINED_AGGR_INDEX_STREAM,
								StreamManager.ROOT_STREAM,
								StreamManager.BASE_SCOPE);
				this.combinedAggrRAOutput = (RAOutputStream) streamManager
						.getOutStream(
								DataEngineContext.COMBINED_AGGR_VALUE_STREAM,
								StreamManager.ROOT_STREAM,
								StreamManager.BASE_SCOPE);
				this.combinedAggrOutput = new DataOutputStream(
						this.combinedAggrRAOutput);
				this.combinedAggrIndexOutput = new DataOutputStream(
						this.combinedAggrIndexRAOutput);

				// write place holder for Overall aggregation index
				IOUtil.writeLong(this.combinedAggrIndexOutput, -1);

				// write the size of overall aggregation
				IOUtil.writeInt(this.combinedAggrOutput,
						this.overallAggrs.size());
				for (int i = 0; i < this.overallAggrs.size(); i++) {
					IOUtil.writeString(this.combinedAggrOutput,
							this.overallAggrs.get(i));
				}

				IOUtil.writeInt(this.combinedAggrOutput,
						this.runningAggrs.size());
				for (int i = 0; i < this.runningAggrs.size(); i++) {
					IOUtil.writeString(this.combinedAggrOutput,
							this.runningAggrs.get(i));
				}

				// write the starting index of first running aggregation
				IOUtil.writeLong(this.combinedAggrIndexOutput,
						this.combinedAggrRAOutput.getOffset());
			}

			for (int i = 0; i < this.groupBys.length; i++) {

				this.groupOutput[i] = (RAOutputStream) streamManager
						.getOutStream(
								DataEngineContext.PROGRESSIVE_VIEWING_GROUP_STREAM,
								i);

				IOUtil.writeInt(this.groupOutput[i], Integer.MAX_VALUE);
				if (!this.groupAggrs.get(i).isEmpty()) {
					this.aggrRAOutput[i] = streamManager.getOutStream(
							DataEngineContext.AGGR_VALUE_STREAM, i);
					this.aggrIndexOutput[i] = new DataOutputStream(
							streamManager.getOutStream(
									DataEngineContext.AGGR_INDEX_STREAM, i));
					this.aggrOutput[i] = new DataOutputStream(
							this.aggrRAOutput[i]);
					// The group level
					IOUtil.writeInt(this.aggrOutput[i], i + 1);
					// The number of aggregations in the group
					IOUtil.writeInt(this.aggrOutput[i], this.groupAggrs
							.get(i).size());
					for (String aggrName : this.groupAggrs.get(i)) {
						IOUtil.writeString(new DataOutputStream(
								this.aggrOutput[i]), aggrName);
					}
					IOUtil.writeLong(this.aggrIndexOutput[i],
							this.aggrRAOutput[i].getOffset());
				}

			}
		}
	} catch (IOException e) {
		throw new DataException(e.getLocalizedMessage(), e);
	}
}