conflict_resolution
stringlengths
27
16k
<<<<<<< import org.voltdb.planner.ParsedSelectStmt.ParsedColInfo; import org.voltdb.plannodes.AbstractJoinPlanNode; ======= >>>>>>> import org.voltdb.plannodes.AbstractJoinPlanNode;
<<<<<<< public void testStringsAsByteArray() throws IOException { params = new ParameterSet(true); ======= public void testStringsAsByteArray() { params = new ParameterSet(); >>>>>>> public void testStringsAsByteArray() throws IOException { params = new ParameterSet(); <<<<<<< private boolean arrayLengthTester(Object[] objs) { params = new ParameterSet(true); params.setParameters(objs); ByteBuffer buf = ByteBuffer.allocate(params.getSerializedSize()); boolean threw = false; try { params.flattenToBuffer(buf); } catch (IOException ioe) { threw = true; } return threw; } public void testArraysTooLong() throws IOException { assertTrue("Array longer than Short.MAX_VALUE didn't fail to serialize", arrayLengthTester(new Object[]{new short[Short.MAX_VALUE + 1]})); assertTrue("Array longer than Short.MAX_VALUE didn't fail to serialize", arrayLengthTester(new Object[]{new int[Short.MAX_VALUE + 1]})); assertTrue("Array longer than Short.MAX_VALUE didn't fail to serialize", arrayLengthTester(new Object[]{new long[Short.MAX_VALUE + 1]})); assertTrue("Array longer than Short.MAX_VALUE didn't fail to serialize", arrayLengthTester(new Object[]{new double[Short.MAX_VALUE + 1]})); assertTrue("Array longer than Short.MAX_VALUE didn't fail to serialize", arrayLengthTester(new Object[]{new String[Short.MAX_VALUE + 1]})); assertTrue("Array longer than Short.MAX_VALUE didn't fail to serialize", arrayLengthTester(new Object[]{new TimestampType[Short.MAX_VALUE + 1]})); assertTrue("Array longer than Short.MAX_VALUE didn't fail to serialize", arrayLengthTester(new Object[]{new BigDecimal[Short.MAX_VALUE + 1]})); } public void testFloatsInsteadOfDouble() throws IOException { params = new ParameterSet(true); ======= public void testFloatsInsteadOfDouble() { params = new ParameterSet(); >>>>>>> private boolean arrayLengthTester(Object[] objs) { params = new ParameterSet(); params.setParameters(objs); ByteBuffer buf = ByteBuffer.allocate(params.getSerializedSize()); boolean threw = false; try { params.flattenToBuffer(buf); } catch (IOException ioe) { threw = true; } return threw; } public void testArraysTooLong() throws IOException { assertTrue("Array longer than Short.MAX_VALUE didn't fail to serialize", arrayLengthTester(new Object[]{new short[Short.MAX_VALUE + 1]})); assertTrue("Array longer than Short.MAX_VALUE didn't fail to serialize", arrayLengthTester(new Object[]{new int[Short.MAX_VALUE + 1]})); assertTrue("Array longer than Short.MAX_VALUE didn't fail to serialize", arrayLengthTester(new Object[]{new long[Short.MAX_VALUE + 1]})); assertTrue("Array longer than Short.MAX_VALUE didn't fail to serialize", arrayLengthTester(new Object[]{new double[Short.MAX_VALUE + 1]})); assertTrue("Array longer than Short.MAX_VALUE didn't fail to serialize", arrayLengthTester(new Object[]{new String[Short.MAX_VALUE + 1]})); assertTrue("Array longer than Short.MAX_VALUE didn't fail to serialize", arrayLengthTester(new Object[]{new TimestampType[Short.MAX_VALUE + 1]})); assertTrue("Array longer than Short.MAX_VALUE didn't fail to serialize", arrayLengthTester(new Object[]{new BigDecimal[Short.MAX_VALUE + 1]})); } public void testFloatsInsteadOfDouble() throws IOException { params = new ParameterSet();
<<<<<<< // if the cluster instance IDs in the snapshot and command log don't match, just move along if (m_replayAgent.getInstanceId() != null && !m_replayAgent.getInstanceId().equals(info.instanceId)) { LOG.debug("Rejecting snapshot due to mismatching instance IDs."); LOG.debug("Command log ID: " + m_replayAgent.getInstanceId().serializeToJSONObject().toString()); LOG.debug("Snapshot ID: " + info.instanceId.serializeToJSONObject().toString()); continue; } if (VoltDB.instance().isIV2Enabled()) { ======= if (VoltDB.instance().isIV2Enabled() && info != null) { >>>>>>> // if the cluster instance IDs in the snapshot and command log don't match, just move along if (m_replayAgent.getInstanceId() != null && info != null && !m_replayAgent.getInstanceId().equals(info.instanceId)) { LOG.debug("Rejecting snapshot due to mismatching instance IDs."); LOG.debug("Command log ID: " + m_replayAgent.getInstanceId().serializeToJSONObject().toString()); LOG.debug("Snapshot ID: " + info.instanceId.serializeToJSONObject().toString()); continue; } if (VoltDB.instance().isIV2Enabled() && info != null) {
<<<<<<< import org.voltcore.logging.VoltLogger; import org.voltcore.utils.DBBPool.BBContainer; import org.voltcore.utils.Pair; import org.voltdb.ExecutionSite.SystemProcedureExecutionContext; ======= import org.voltdb.ExecutionSite.SystemProcedureExecutionContext; >>>>>>> import org.voltcore.logging.VoltLogger; import org.voltcore.utils.DBBPool.BBContainer; import org.voltcore.utils.Pair; import org.voltdb.ExecutionSite.SystemProcedureExecutionContext; <<<<<<< ======= import org.voltdb.logging.VoltLogger; >>>>>>> <<<<<<< ======= import org.voltdb.utils.DBBPool.BBContainer; import org.voltdb.utils.Pair; >>>>>>>
<<<<<<< static { listing.put("@AdHoc_RW_MP", new Config("org.voltdb.sysprocs.AdHoc_RW_MP", false, false, false, false, false, true)); listing.put("@AdHoc_RW_SP", new Config("org.voltdb.sysprocs.AdHoc_RW_SP", false, false, false, false, false, true)); listing.put("@AdHoc_RO_MP", new Config("org.voltdb.sysprocs.AdHoc_RO_MP", true, false, false, false, false, true)); listing.put("@AdHoc_RO_SP", new Config("org.voltdb.sysprocs.AdHoc_RO_SP", true, false, false, false, false, true)); listing.put("@Pause", new Config("org.voltdb.sysprocs.Pause", false, true, false, false, true, true)); listing.put("@Resume", new Config("org.voltdb.sysprocs.Resume", false, true, false, false, true, true)); listing.put("@Quiesce", new Config("org.voltdb.sysprocs.Quiesce", false, false, false, false, true, true)); listing.put("@SnapshotSave", new Config("org.voltdb.sysprocs.SnapshotSave", false, false, false, false, true, true)); listing.put("@SnapshotRestore", new Config("org.voltdb.sysprocs.SnapshotRestore", false, false, false, true, true, false)); listing.put("@SnapshotStatus", new Config("org.voltdb.sysprocs.SnapshotStatus", false, false, false, false, true, true)); listing.put("@SnapshotScan", new Config("org.voltdb.sysprocs.SnapshotScan", false, false, false, false, true, true)); listing.put("@SnapshotDelete", new Config("org.voltdb.sysprocs.SnapshotDelete", false, false, false, false, true, true)); listing.put("@Shutdown", new Config("org.voltdb.sysprocs.Shutdown", false, false, false, false, true, true)); listing.put("@ProfCtl", new Config("org.voltdb.sysprocs.ProfCtl", false, false, false, false, true, true)); listing.put("@Statistics", new Config("org.voltdb.sysprocs.Statistics", true, false, false, false, true, true)); listing.put("@SystemCatalog", new Config("org.voltdb.sysprocs.SystemCatalog", true, false, false, false, true, true)); listing.put("@SystemInformation", new Config("org.voltdb.sysprocs.SystemInformation", true, false, false, false, true, true)); listing.put("@UpdateLogging", new Config("org.voltdb.sysprocs.UpdateLogging", false, true, false, false, true, true)); listing.put("@BalancePartitions", new Config("org.voltdb.sysprocs.BalancePartitions", false, false, true, true, true, false)); listing.put("@UpdateApplicationCatalog",new Config("org.voltdb.sysprocs.UpdateApplicationCatalog", false, true, false, true, true, false)); listing.put("@LoadMultipartitionTable", new Config("org.voltdb.sysprocs.LoadMultipartitionTable", false, false, false, false, false, false)); listing.put("@LoadSinglepartitionTable",new Config("org.voltdb.sysprocs.LoadSinglepartitionTable", false, false, false, false, false, false)); listing.put("@Promote", new Config("org.voltdb.sysprocs.Promote", false, true, false, false, true, true)); ======= static { // SP RO Every Pro (DR: kill, skip, replica-ok) listing.put("@AdHoc", new Config("org.voltdb.sysprocs.AdHoc", false, false, false, false, false, false, true)); listing.put("@AdHocSP", new Config("org.voltdb.sysprocs.AdHocSP", true, false, false, false, false, false, true)); listing.put("@Pause", new Config("org.voltdb.sysprocs.Pause", false, false, true, false, false, true, true)); listing.put("@Resume", new Config("org.voltdb.sysprocs.Resume", false, false, true, false, false, true, true)); listing.put("@Quiesce", new Config("org.voltdb.sysprocs.Quiesce", false, false, false, false, false, true, true)); listing.put("@SnapshotSave", new Config("org.voltdb.sysprocs.SnapshotSave", false, false, false, false, false, true, true)); listing.put("@SnapshotRestore", new Config("org.voltdb.sysprocs.SnapshotRestore", false, false, false, false, true, true, false)); listing.put("@SnapshotStatus", new Config("org.voltdb.sysprocs.SnapshotStatus", false, false, false, false, false, true, true)); listing.put("@SnapshotScan", new Config("org.voltdb.sysprocs.SnapshotScan", false, false, false, false, false, true, true)); listing.put("@SnapshotDelete", new Config("org.voltdb.sysprocs.SnapshotDelete", false, false, false, false, false, true, true)); listing.put("@Shutdown", new Config("org.voltdb.sysprocs.Shutdown", false, false, false, false, false, true, true)); listing.put("@ProfCtl", new Config("org.voltdb.sysprocs.ProfCtl", false, false, false, false, false, true, true)); listing.put("@Statistics", new Config("org.voltdb.sysprocs.Statistics", false, true, false, false, false, true, true)); listing.put("@SystemCatalog", new Config("org.voltdb.sysprocs.SystemCatalog", true, true, false, false, false, true, true)); listing.put("@SystemInformation", new Config("org.voltdb.sysprocs.SystemInformation", false, true, false, false, false, true, true)); listing.put("@UpdateLogging", new Config("org.voltdb.sysprocs.UpdateLogging", false, false, true, false, false, true, true)); listing.put("@BalancePartitions", new Config("org.voltdb.sysprocs.BalancePartitions", false, false, false, true, true, true, false)); listing.put("@UpdateApplicationCatalog",new Config("org.voltdb.sysprocs.UpdateApplicationCatalog", true, false, true, false, true, true, false)); listing.put("@LoadMultipartitionTable", new Config("org.voltdb.sysprocs.LoadMultipartitionTable", false, false, false, false, false, false, false)); listing.put("@LoadSinglepartitionTable",new Config("org.voltdb.sysprocs.LoadSinglepartitionTable", true, false, false, false, false, false, false)); listing.put("@Promote", new Config("org.voltdb.sysprocs.Promote", false, false, true, false, false, true, true)); >>>>>>> static { // SP RO Every Pro (DR: kill, skip, replica-ok) listing.put("@AdHoc_RW_MP", new Config("org.voltdb.sysprocs.AdHoc_RW_MP", false, false, false, false, false, false, true)); listing.put("@AdHoc_RW_SP", new Config("org.voltdb.sysprocs.AdHoc_RW_SP", true, false, false, false, false, false, true)); listing.put("@AdHoc_RO_MP", new Config("org.voltdb.sysprocs.AdHoc_RO_MP", false, true, false, false, false, false, true)); listing.put("@AdHoc_RO_SP", new Config("org.voltdb.sysprocs.AdHoc_RO_SP", true, true, false, false, false, false, true)); listing.put("@Pause", new Config("org.voltdb.sysprocs.Pause", false, false, true, false, false, true, true)); listing.put("@Resume", new Config("org.voltdb.sysprocs.Resume", false, false, true, false, false, true, true)); listing.put("@Quiesce", new Config("org.voltdb.sysprocs.Quiesce", false, false, false, false, false, true, true)); listing.put("@SnapshotSave", new Config("org.voltdb.sysprocs.SnapshotSave", false, false, false, false, false, true, true)); listing.put("@SnapshotRestore", new Config("org.voltdb.sysprocs.SnapshotRestore", false, false, false, false, true, true, false)); listing.put("@SnapshotStatus", new Config("org.voltdb.sysprocs.SnapshotStatus", false, false, false, false, false, true, true)); listing.put("@SnapshotScan", new Config("org.voltdb.sysprocs.SnapshotScan", false, false, false, false, false, true, true)); listing.put("@SnapshotDelete", new Config("org.voltdb.sysprocs.SnapshotDelete", false, false, false, false, false, true, true)); listing.put("@Shutdown", new Config("org.voltdb.sysprocs.Shutdown", false, false, false, false, false, true, true)); listing.put("@ProfCtl", new Config("org.voltdb.sysprocs.ProfCtl", false, false, false, false, false, true, true)); listing.put("@Statistics", new Config("org.voltdb.sysprocs.Statistics", false, true, false, false, false, true, true)); listing.put("@SystemCatalog", new Config("org.voltdb.sysprocs.SystemCatalog", true, true, false, false, false, true, true)); listing.put("@SystemInformation", new Config("org.voltdb.sysprocs.SystemInformation", false, true, false, false, false, true, true)); listing.put("@UpdateLogging", new Config("org.voltdb.sysprocs.UpdateLogging", false, false, true, false, false, true, true)); listing.put("@BalancePartitions", new Config("org.voltdb.sysprocs.BalancePartitions", false, false, false, true, true, true, false)); listing.put("@UpdateApplicationCatalog",new Config("org.voltdb.sysprocs.UpdateApplicationCatalog", true, false, true, false, true, true, false)); listing.put("@LoadMultipartitionTable", new Config("org.voltdb.sysprocs.LoadMultipartitionTable", false, false, false, false, false, false, false)); listing.put("@LoadSinglepartitionTable",new Config("org.voltdb.sysprocs.LoadSinglepartitionTable", true, false, false, false, false, false, false)); listing.put("@Promote", new Config("org.voltdb.sysprocs.Promote", false, false, true, false, false, true, true));
<<<<<<< ======= import java.util.Set; import java.util.SortedMap; >>>>>>> import java.util.Set;
<<<<<<< import org.voltdb.messaging.BorrowTaskMessage; import org.voltdb.messaging.InitiateResponseMessage; import org.voltdb.ProcedureRunner; import org.voltdb.StoredProcedureInvocation; ======= import org.voltdb.CommandLog; import org.voltdb.SystemProcedureCatalog; >>>>>>> import org.voltdb.messaging.BorrowTaskMessage; import org.voltdb.messaging.InitiateResponseMessage; import org.voltdb.StoredProcedureInvocation; import org.voltdb.CommandLog; import org.voltdb.SystemProcedureCatalog; <<<<<<< if (!runner.isEverySite()) { StoredProcedureInvocation invocation = msg.getStoredProcedureInvocation(); if (invocation.getType() == ProcedureInvocationType.REPLICATED) { msg.setTxnId(invocation.getOriginalTxnId()); } else { msg.setTxnId(newSpHandle); } ======= // Only system procedures are every-site, so we'll check through the SystemProcedureCatalog if (SystemProcedureCatalog.listing.get(procedureName) == null || !SystemProcedureCatalog.listing.get(procedureName).getEverysite()) { msg.setTxnId(newSpHandle); msg.setTimestamp(timestamp); >>>>>>> // Only system procedures are every-site, so we'll check through the SystemProcedureCatalog if (SystemProcedureCatalog.listing.get(procedureName) == null || !SystemProcedureCatalog.listing.get(procedureName).getEverysite()) { StoredProcedureInvocation invocation = msg.getStoredProcedureInvocation(); if (invocation.getType() == ProcedureInvocationType.REPLICATED) { msg.setTxnId(invocation.getOriginalTxnId()); } else { msg.setTxnId(newSpHandle); } msg.setTimestamp(timestamp); <<<<<<< new SpProcedureTask(m_mailbox, runner, newSpHandle, m_pendingTasks, msg, m_drGateway); ======= new SpProcedureTask(m_mailbox, procedureName, m_pendingTasks, msg); >>>>>>> new SpProcedureTask(m_mailbox, procedureName, m_pendingTasks, msg, m_drGateway); <<<<<<< final SpProcedureTask task = new SpProcedureTask(m_mailbox, runner, localWork.getSpHandle(), m_pendingTasks, localWork, m_drGateway); ======= final SpProcedureTask task = new SpProcedureTask(m_mailbox, procedureName, m_pendingTasks, localWork); >>>>>>> final SpProcedureTask task = new SpProcedureTask(m_mailbox, procedureName, m_pendingTasks, localWork, m_drGateway);
<<<<<<< ======= if (mAccountWasSet) { RelativeLayout navigationDrawerLayout = (RelativeLayout) findViewById(R.id.left_drawer); if (navigationDrawerLayout != null && getAccount() != null) { TextView username = (TextView) navigationDrawerLayout.findViewById(R.id.drawer_username); int lastAtPos = getAccount().name.lastIndexOf("@"); username.setText(getAccount().name.substring(0, lastAtPos)); } } >>>>>>> if (mAccountWasSet) { RelativeLayout navigationDrawerLayout = (RelativeLayout) findViewById(R.id.left_drawer); if (navigationDrawerLayout != null && getAccount() != null) { TextView username = (TextView) navigationDrawerLayout.findViewById(R.id.drawer_username); int lastAtPos = getAccount().name.lastIndexOf("@"); username.setText(getAccount().name.substring(0, lastAtPos)); } } <<<<<<< OCFileListFragment listOfFiles = getListOfFilesFragment(); if (mDualPane || getSecondFragment() == null) { OCFile currentDir = getCurrentDir(); if (currentDir == null || currentDir.getParentId() == FileDataStorageManager.ROOT_PARENT_ID) { finish(); return; ======= if (!isDrawerOpen()){ OCFileListFragment listOfFiles = getListOfFilesFragment(); if (mDualPane || getSecondFragment() == null) { OCFile currentDir = getCurrentDir(); if (currentDir == null || currentDir.getParentId() == FileDataStorageManager.ROOT_PARENT_ID) { finish(); return; } if (listOfFiles != null) { // should never be null, indeed listOfFiles.onBrowseUp(); } >>>>>>> if (!isDrawerOpen()){ OCFileListFragment listOfFiles = getListOfFilesFragment(); if (mDualPane || getSecondFragment() == null) { OCFile currentDir = getCurrentDir(); if (currentDir == null || currentDir.getParentId() == FileDataStorageManager.ROOT_PARENT_ID) { finish(); return; } if (listOfFiles != null) { // should never be null, indeed listOfFiles.onBrowseUp(); } <<<<<<< ======= mProgressBar.setIndeterminate(false); >>>>>>> mProgressBar.setIndeterminate(false); <<<<<<< setSupportProgressBarIndeterminateVisibility(true); ======= mProgressBar.setIndeterminate(true); >>>>>>> mProgressBar.setIndeterminate(true);
<<<<<<< // Start listening on the DR ports prepareReplication(); } ======= try { if (m_adminListener != null) { m_adminListener.start(); } } catch (Exception e) { hostLog.l7dlog(Level.FATAL, LogKeys.host_VoltDB_ErrorStartHTTPListener.name(), e); VoltDB.crashLocalVoltDB("HTTP service unable to bind to port.", true, e); } // Start listening on the DR ports prepareReplication(); >>>>>>> // Start listening on the DR ports prepareReplication(); } try { if (m_adminListener != null) { m_adminListener.start(); } } catch (Exception e) { hostLog.l7dlog(Level.FATAL, LogKeys.host_VoltDB_ErrorStartHTTPListener.name(), e); VoltDB.crashLocalVoltDB("HTTP service unable to bind to port.", true, e); }
<<<<<<< "Asking for fixed size for non-fixed or unknown type:" + name()); ======= "Asked for fixed size of non-fixed type " + m_sqlString); >>>>>>> "Asking for fixed size for non-fixed or unknown type:" + m_sqlString);
<<<<<<< ======= // Self JOIN . Temporary restriction failToCompile("select R1.C FROM R1 LEFT OUTER JOIN R2 ON R1.C = R2.C RIGHT JOIN R2 ON R2.C = R1.C", "VoltDB does not support self joins, consider using views instead"); >>>>>>>
<<<<<<< static VoltXMLElement voltGetXMLExpression(QueryExpression queryExpr, ExpressionColumn parameters[], Session session) throws HSQLParseException ======= VoltXMLElement voltGetXMLExpression(QueryExpression queryExpr, Session session) throws org.hsqldb_voltpatches.HSQLInterface.HSQLParseException >>>>>>> static VoltXMLElement voltGetXMLExpression(QueryExpression queryExpr, ExpressionColumn parameters[], Session session) throws org.hsqldb_voltpatches.HSQLInterface.HSQLParseException <<<<<<< static VoltXMLElement voltGetXMLSpecification(QuerySpecification select, ExpressionColumn parameters[], Session session) throws HSQLParseException { ======= VoltXMLElement voltGetXMLSpecification(QuerySpecification select, Session session) throws org.hsqldb_voltpatches.HSQLInterface.HSQLParseException { >>>>>>> static VoltXMLElement voltGetXMLSpecification(QuerySpecification select, ExpressionColumn parameters[], Session session) throws org.hsqldb_voltpatches.HSQLInterface.HSQLParseException { <<<<<<< static protected void extractColumnReferences(VoltXMLElement element, List<VoltXMLElement> cols) { ======= protected void extractColumnReferences(VoltXMLElement element, java.util.List<VoltXMLElement> cols) { >>>>>>> static protected void extractColumnReferences(VoltXMLElement element, java.util.List<VoltXMLElement> cols) { <<<<<<< static protected void resolveUsingColumns(List<VoltXMLElement> columns, RangeVariable[] rvs) throws HSQLParseException { ======= protected void resolveUsingColumns(java.util.List<VoltXMLElement> columns, RangeVariable[] rvs) throws org.hsqldb_voltpatches.HSQLInterface.HSQLParseException { >>>>>>> static protected void resolveUsingColumns(java.util.List<VoltXMLElement> columns, RangeVariable[] rvs) throws org.hsqldb_voltpatches.HSQLInterface.HSQLParseException {
<<<<<<< // Additional restrictions apply to LIKE pattern arguments if (targetComparator == ExpressionType.COMPARE_LIKE) { if (otherExpr instanceof ParameterValueExpression) { ParameterValueExpression pve = (ParameterValueExpression)otherExpr; // Can't use an index for parameterized LIKE filters, // e.g. "T1.column LIKE ?" // UNLESS the parameter was artificially substituted // for a user-specified constant AND that constant was a prefix pattern. // In that case, the parameter has to be added to the bound list // for this index/statement. ConstantValueExpression cve = pve.getOriginalValue(); if (cve == null || ! cve.isPrefixPatternString()) { binding = null; // the filter is not usable, so the binding is invalid continue; } // Remember that the binding list returned by // bindingIfValidIndexedFilterOperand above // is often a "shared object" and is intended to be treated as immutable. // To add a parameter to it, first copy the List. List<AbstractExpression> moreBinding = new ArrayList<AbstractExpression>(binding); moreBinding.add(pve); binding = moreBinding; } else if (otherExpr instanceof ConstantValueExpression) { // Can't use an index for non-prefix LIKE filters, // e.g. " T1.column LIKE '%ish' " ConstantValueExpression cve = (ConstantValueExpression)otherExpr; if ( ! cve.isPrefixPatternString()) { // The constant is not an index-friendly prefix pattern. binding = null; // the filter is not usable, so the binding is invalid continue; } } else { // Other cases are not indexable, e.g. " T1.column LIKE T2.column " binding = null; // the filter is not usable, so the binding is invalid continue; } } if (filterAction == EXCLUDE_FROM_POST_FILTERS) { filtersToCover.remove(filter); } ======= originalFilter = filter; filtersToCover.remove(filter); >>>>>>> // Additional restrictions apply to LIKE pattern arguments if (targetComparator == ExpressionType.COMPARE_LIKE) { if (otherExpr instanceof ParameterValueExpression) { ParameterValueExpression pve = (ParameterValueExpression)otherExpr; // Can't use an index for parameterized LIKE filters, // e.g. "T1.column LIKE ?" // UNLESS the parameter was artificially substituted // for a user-specified constant AND that constant was a prefix pattern. // In that case, the parameter has to be added to the bound list // for this index/statement. ConstantValueExpression cve = pve.getOriginalValue(); if (cve == null || ! cve.isPrefixPatternString()) { binding = null; // the filter is not usable, so the binding is invalid continue; } // Remember that the binding list returned by // bindingIfValidIndexedFilterOperand above // is often a "shared object" and is intended to be treated as immutable. // To add a parameter to it, first copy the List. List<AbstractExpression> moreBinding = new ArrayList<AbstractExpression>(binding); moreBinding.add(pve); binding = moreBinding; } else if (otherExpr instanceof ConstantValueExpression) { // Can't use an index for non-prefix LIKE filters, // e.g. " T1.column LIKE '%ish' " ConstantValueExpression cve = (ConstantValueExpression)otherExpr; if ( ! cve.isPrefixPatternString()) { // The constant is not an index-friendly prefix pattern. binding = null; // the filter is not usable, so the binding is invalid continue; } } else { // Other cases are not indexable, e.g. " T1.column LIKE T2.column " binding = null; // the filter is not usable, so the binding is invalid continue; } } originalFilter = filter; if (filterAction == EXCLUDE_FROM_POST_FILTERS) { filtersToCover.remove(filter); } <<<<<<< if (filterAction == EXCLUDE_FROM_POST_FILTERS) { filtersToCover.remove(filter); } ======= originalFilter = filter; filtersToCover.remove(filter); >>>>>>> originalFilter = filter; if (filterAction == EXCLUDE_FROM_POST_FILTERS) { filtersToCover.remove(filter); }
<<<<<<< StatementCompiler.DEFAULT_MAX_JOIN_TABLES, null); //TODO: Some day, when compilePlan throws a proper PlanningErrorException for all error cases, this test can become an assert. ======= StatementCompiler.DEFAULT_MAX_JOIN_TABLES, null, false); >>>>>>> StatementCompiler.DEFAULT_MAX_JOIN_TABLES, null, false); //TODO: Some day, when compilePlan throws a proper PlanningErrorException for all error cases, this test can become an assert.
<<<<<<< boolean groupByIsAnOrderByPermutation() { if (groupAndOrderByPermutationWasTested) { return groupAndOrderByPermutationResult; } groupAndOrderByPermutationWasTested = true; int size = groupByColumns.size(); if (size != orderColumns.size()) { return false; } Set<AbstractExpression> orderPrefixExprs = new HashSet<>(size); Set<AbstractExpression> groupExprs = new HashSet<>(size); int ii = 0; for (ParsedColInfo gb : groupByColumns) { AbstractExpression gexpr = gb.expression; if (gb.expression == null) { return false; } AbstractExpression oexpr = orderColumns.get(ii).expression; ++ii; // Save some cycles in the common case of matching by position. if (gb.expression.equals(oexpr)) { continue; } groupExprs.add(gexpr); orderPrefixExprs.add(oexpr); } groupAndOrderByPermutationResult = groupExprs.equals(orderPrefixExprs); return groupAndOrderByPermutationResult; } ======= void checkPlanColumnMatch(List<SchemaColumn> columns) { // Sanity-check the output NodeSchema columns against the display columns if (displayColumns.size() != columns.size()) { throw new PlanningErrorException( "Mismatched plan output cols to parsed display columns"); } int ii = 0; for (ParsedColInfo display_col : displayColumns) { SchemaColumn sc = columns.get(ii); ++ii; boolean sameTable = false; if (display_col.tableAlias != null) { if (display_col.tableAlias.equals(sc.getTableAlias())) { sameTable = true; } } else if (display_col.tableName.equals(sc.getTableName())) { sameTable = true; } if (sameTable) { if (display_col.alias != null && ! display_col.alias.equals("")) { if (display_col.alias.equals(sc.getColumnAlias())) { continue; } } else if (display_col.columnName != null && ! display_col.columnName.equals("")) { if (display_col.columnName.equals(sc.getColumnName())) { continue; } } } throw new PlanningErrorException( "Mismatched plan output cols to parsed display columns"); } } >>>>>>> boolean groupByIsAnOrderByPermutation() { if (groupAndOrderByPermutationWasTested) { return groupAndOrderByPermutationResult; } groupAndOrderByPermutationWasTested = true; int size = groupByColumns.size(); if (size != orderColumns.size()) { return false; } Set<AbstractExpression> orderPrefixExprs = new HashSet<>(size); Set<AbstractExpression> groupExprs = new HashSet<>(size); int ii = 0; for (ParsedColInfo gb : groupByColumns) { AbstractExpression gexpr = gb.expression; if (gb.expression == null) { return false; } AbstractExpression oexpr = orderColumns.get(ii).expression; ++ii; // Save some cycles in the common case of matching by position. if (gb.expression.equals(oexpr)) { continue; } groupExprs.add(gexpr); orderPrefixExprs.add(oexpr); } groupAndOrderByPermutationResult = groupExprs.equals(orderPrefixExprs); return groupAndOrderByPermutationResult; } void checkPlanColumnMatch(List<SchemaColumn> columns) { // Sanity-check the output NodeSchema columns against the display columns if (displayColumns.size() != columns.size()) { throw new PlanningErrorException( "Mismatched plan output cols to parsed display columns"); } int ii = 0; for (ParsedColInfo display_col : displayColumns) { SchemaColumn sc = columns.get(ii); ++ii; boolean sameTable = false; if (display_col.tableAlias != null) { if (display_col.tableAlias.equals(sc.getTableAlias())) { sameTable = true; } } else if (display_col.tableName.equals(sc.getTableName())) { sameTable = true; } if (sameTable) { if (display_col.alias != null && ! display_col.alias.equals("")) { if (display_col.alias.equals(sc.getColumnAlias())) { continue; } } else if (display_col.columnName != null && ! display_col.columnName.equals("")) { if (display_col.columnName.equals(sc.getColumnName())) { continue; } } } throw new PlanningErrorException( "Mismatched plan output cols to parsed display columns"); } }
<<<<<<< ======= // wait till RealVoltDB says a catalog has been found try { m_rvdb.m_hasCatalog.await(); } catch (InterruptedException e1) { VoltDB.crashLocalVoltDB("System was interrupted while waiting for a catalog.", false, e1); } // Initialize the catalog and some common shortcuts if (m_config.m_pathToCatalog.startsWith("http")) { hostLog.info("Loading application catalog jarfile from " + m_config.m_pathToCatalog); } else { File f = new File(m_config.m_pathToCatalog); hostLog.info("Loading application catalog jarfile from " + f.getAbsolutePath()); } >>>>>>> <<<<<<< do { try { catalogBytes = m_rvdb.getHostMessenger().getZK().getData(VoltZK.catalogbytes, false, null); } catch (org.apache.zookeeper_voltpatches.KeeperException.NoNodeException e) { } catch (Exception e) { hostLog.fatal("System was interrupted while waiting for a catalog."); VoltDB.crashVoltDB(); } } while (catalogBytes == null); ======= try { catalogBytes = CatalogUtil.toBytes(new File(m_config.m_pathToCatalog)); } catch (IOException e) { VoltDB.crashLocalVoltDB("Failed to read catalog: " + e.getMessage(), false, e); } >>>>>>> do { try { catalogBytes = m_rvdb.getHostMessenger().getZK().getData(VoltZK.catalogbytes, false, null); } catch (org.apache.zookeeper_voltpatches.KeeperException.NoNodeException e) { } catch (Exception e) { VoltDB.crashLocalVoltDB("System was interrupted while waiting for a catalog.", false, null); } } while (catalogBytes == null);
<<<<<<< ======= //test_Interface_lineByLine( mySchema, 7, myOptions, myData, invalidLineCnt ); >>>>>>> <<<<<<< ======= public void test_Interface_lineByLine( String my_schema, int columnCnt, String[] my_options, String[] my_data, int invalidLineCnt, String[] addStr ) throws Exception { try{ BufferedWriter out_csv = new BufferedWriter( new FileWriter( path_csv ) ); for( int i = 0; i < my_data.length; i++ ) out_csv.write( my_data[ i ]+"\n" ); out_csv.flush(); out_csv.close(); } catch( Exception e) { System.err.print( e.getMessage() ); } try{ pathToCatalog = Configuration.getPathToCatalogForTest("csv.jar"); pathToDeployment = Configuration.getPathToCatalogForTest("csv.xml"); builder = new VoltProjectBuilder(); //builder.addStmtProcedure("Insert", "insert into blah values (?, ?, ?);", null); //builder.addStmtProcedure("InsertWithDate", "INSERT INTO BLAH VALUES (974599638818488300, 5, 'nullchar');"); builder.addLiteralSchema(my_schema); builder.addPartitionInfo("BLAH", "clm_integer"); boolean success = builder.compile(pathToCatalog, 2, 1, 0); assertTrue(success); MiscUtils.copyFile(builder.getPathToDeployment(), pathToDeployment); config = new VoltDB.Configuration(); config.m_pathToCatalog = pathToCatalog; config.m_pathToDeployment = pathToDeployment; localServer = new ServerThread(config); client = null; localServer.start(); localServer.waitForInitialization(); client = ClientFactory.createClient(); client.createConnection("localhost"); new CSVLoader( my_options ); while( CSVLoader.readNext() ) { CSVLoader.insertLine( addStr, columnCnt ); } CSVLoader.drain(); CSVLoader.produceFiles(); CSVLoader.flush(); // do the test VoltTable modCount; modCount = client.callProcedure("@AdHoc", "SELECT * FROM BLAH;").getResults()[0]; System.out.println("data inserted to table BLAH:\n" + modCount); int rowct = modCount.getRowCount(); BufferedReader csvreport = new BufferedReader(new FileReader(CSVLoader.path_reportfile)); int lineCount = 0; String line = ""; String promptMsg = "Number of acknowledged tuples:"; String promptFailMsg = "Number of failed tuples:"; int invalidlinecnt = 0; while ((line = csvreport.readLine()) != null) { if (line.startsWith(promptMsg)) { String num = line.substring(promptMsg.length()); lineCount = Integer.parseInt(num.replaceAll("\\s","")); } if( line.startsWith(promptFailMsg)){ String num = line.substring(promptFailMsg.length()); invalidlinecnt = Integer.parseInt(num.replaceAll("\\s","")); } } System.out.println(String.format("The rows infected: (%d,%s)", lineCount, rowct)); assertEquals(lineCount, rowct); assertEquals(invalidLineCnt,invalidlinecnt); } finally { if (client != null) client.close(); client = null; if (localServer != null) { localServer.shutdown(); localServer.join(); } localServer = null; // no clue how helpful this is System.gc(); } } >>>>>>>
<<<<<<< import org.voltdb.planner.ParsedSelectStmt.ParsedColInfo; ======= import org.voltdb.planner.ParsedSelectStmt.MVFixInfo; >>>>>>> import org.voltdb.planner.ParsedSelectStmt.ParsedColInfo; import org.voltdb.planner.ParsedSelectStmt.MVFixInfo; <<<<<<< AggregatePlanNode topAggNode; if (m_partitioning.requiresTwoFragments()) { AbstractPlanNode candidate = root.getChild(0).getChild(0); candidate = indexAccessForGroupByExprs(candidate); if (candidate.getPlanNodeType() == PlanNodeType.INDEXSCAN) { candidate.clearParents(); root.getChild(0).clearChildren(); root.getChild(0).addAndLinkChild(candidate); } } else { root = indexAccessForGroupByExprs(root); } ======= AggregatePlanNode topAggNode = null; >>>>>>> AggregatePlanNode topAggNode = null; if (m_partitioning.requiresTwoFragments()) { AbstractPlanNode candidate = root.getChild(0).getChild(0); candidate = indexAccessForGroupByExprs(candidate); if (candidate.getPlanNodeType() == PlanNodeType.INDEXSCAN) { candidate.clearParents(); root.getChild(0).clearChildren(); root.getChild(0).addAndLinkChild(candidate); } } else { root = indexAccessForGroupByExprs(root); } <<<<<<< topAggNode = new HashAggregatePlanNode(); if (!m_partitioning.requiresTwoFragments() || m_parsedSelect.isGrouped() && (root.getChild(0).getChild(0).getPlanNodeType() != PlanNodeType.INDEXSCAN || ((IndexScanPlanNode) root.getChild(0).getChild(0)).getSortDirection() == SortDirectionType.INVALID)) { aggNode = new HashAggregatePlanNode(); } else { aggNode = new AggregatePlanNode(); } ======= aggNode = new HashAggregatePlanNode(); if (!m_parsedSelect.mvFixInfo.needed) { topAggNode = new HashAggregatePlanNode(); } >>>>>>> if (!m_partitioning.requiresTwoFragments() || m_parsedSelect.isGrouped() && (root.getChild(0).getChild(0).getPlanNodeType() != PlanNodeType.INDEXSCAN || ((IndexScanPlanNode) root.getChild(0).getChild(0)).getSortDirection() == SortDirectionType.INVALID)) { aggNode = new HashAggregatePlanNode(); } else { aggNode = new AggregatePlanNode(); } if (!m_parsedSelect.mvFixInfo.needed) { topAggNode = new HashAggregatePlanNode(); }
<<<<<<< import org.voltdb.TheHashinator.HashinatorType; import org.voltdb.VoltDB.START_ACTION; ======= >>>>>>> import org.voltdb.TheHashinator.HashinatorType; <<<<<<< m_config.m_startAction == START_ACTION.LIVE_REJOIN); m_messenger.registerMailbox(m_joinCoordinator); if (m_config.m_startAction == START_ACTION.LIVE_REJOIN) { ======= m_config.m_startAction == StartAction.LIVE_REJOIN); m_messenger.registerMailbox(m_rejoinCoordinator); if (m_config.m_startAction == StartAction.LIVE_REJOIN) { >>>>>>> m_config.m_startAction == StartAction.LIVE_REJOIN); m_messenger.registerMailbox(m_joinCoordinator); if (m_config.m_startAction == StartAction.LIVE_REJOIN) { <<<<<<< private JSONObject getTopology(START_ACTION startAction, JoinCoordinator joinCoordinator) ======= private JSONObject getTopology(StartAction startAction, Joiner joinCoordinator) >>>>>>> private JSONObject getTopology(StartAction startAction, JoinCoordinator joinCoordinator)
<<<<<<< /** * loadTable method used internally by ExecutionSite/Site clients */ public void loadTable(long txnId, int tableId, VoltTable data); ======= /** * Get the EE's plan fragment ID for a given JSON plan. * May pull from cache or load on the spot. */ public long loadPlanFragment(byte[] plan) throws EEException; >>>>>>> /** * loadTable method used internally by ExecutionSite/Site clients */ public void loadTable(long txnId, int tableId, VoltTable data); /** * Get the EE's plan fragment ID for a given JSON plan. * May pull from cache or load on the spot. */ public long loadPlanFragment(byte[] plan) throws EEException; <<<<<<< public VoltTable executeCustomPlanFragment(String plan, int inputDepId, long txnId, ParameterSet params, boolean readOnly); ======= >>>>>>>
<<<<<<< import org.voltdb.planner.AbstractParsedStmt; import org.voltdb.planner.parseinfo.StmtTableScan; ======= import org.voltdb.planner.StmtTableScan; >>>>>>> import org.voltdb.planner.parseinfo.StmtTableScan;
<<<<<<< final String imageKey = String.valueOf(mFile.getRemoteId()); // Check disk cache in background thread thumbnail = getBitmapFromDiskCache(imageKey); // Not found in disk cache if (thumbnail == null || mFile.needsUpdateThumbnail()) { // Use Width of imageView -> no blurry images on big screens int px = mImageViewReference.get().getWidth(); if (mFile.isDown()){ Bitmap bitmap = BitmapUtils.decodeSampledBitmapFromFile( mFile.getStoragePath(), px, px); if (bitmap != null) { thumbnail = ThumbnailUtils.extractThumbnail(bitmap, px, px); // Add thumbnail to cache addBitmapToCache(imageKey, thumbnail); ======= >>>>>>> final String imageKey = String.valueOf(mFile.getRemoteId()); // Check disk cache in background thread thumbnail = getBitmapFromDiskCache(imageKey); // Not found in disk cache if (thumbnail == null || mFile.needsUpdateThumbnail()) { // Use Width of imageView -> no blurry images on big screens int px = mImageViewReference.get().getWidth(); if (mFile.isDown()){ Bitmap bitmap = BitmapUtils.decodeSampledBitmapFromFile( mFile.getStoragePath(), px, px); if (bitmap != null) { thumbnail = ThumbnailUtils.extractThumbnail(bitmap, px, px); // Add thumbnail to cache addBitmapToCache(imageKey, thumbnail); <<<<<<< imageView.setImageBitmap(bitmap); ======= String tagId = ""; if (mFile instanceof OCFile){ tagId = String.valueOf(((OCFile)mFile).getFileId()); } else if (mFile instanceof File){ tagId = String.valueOf(((File)mFile).hashCode()); } if (String.valueOf(imageView.getTag()).equals(tagId)) { imageView.setImageBitmap(bitmap); } >>>>>>> String tagId = ""; if (mFile instanceof OCFile){ tagId = String.valueOf(((OCFile)mFile).getFileId()); } else if (mFile instanceof File){ tagId = String.valueOf(((File)mFile).hashCode()); } if (String.valueOf(imageView.getTag()).equals(tagId)) { imageView.setImageBitmap(bitmap); }
<<<<<<< import com.actionbarsherlock.app.ActionBar; import com.actionbarsherlock.app.ActionBar.OnNavigationListener; import com.actionbarsherlock.view.Menu; import com.actionbarsherlock.view.MenuInflater; import com.actionbarsherlock.view.MenuItem; ======= >>>>>>> <<<<<<< * Displays local files and let the user choose which file to upload to the * current ownCloud account. Selected files are sent back to the caller as Extra * named EXTRA_CHOSEN_FILES. Thus, this activity does not perform the upload * itself. (It should thus be renamed to FileUploadChooserActivity or something) * * @author David A. Velasco * ======= * Displays local files and let the user choose what of them wants to upload * to the current ownCloud account >>>>>>> * Displays local files and let the user choose what of them wants to upload * to the current ownCloud account
<<<<<<< ======= import org.json_voltpatches.JSONException; import org.json_voltpatches.JSONObject; import org.voltdb.ParameterSet; import org.voltdb.VoltType; >>>>>>> import org.json_voltpatches.JSONException; import org.json_voltpatches.JSONObject; import org.voltdb.ParameterSet; import org.voltdb.VoltType; <<<<<<< ======= import org.voltdb.expressions.AbstractExpression; import org.voltdb.expressions.ParameterValueExpression; import org.voltdb.planner.microoptimizations.MicroOptimizationRunner; >>>>>>> import org.voltdb.expressions.AbstractExpression; import org.voltdb.expressions.ParameterValueExpression; import org.voltdb.planner.microoptimizations.MicroOptimizationRunner; <<<<<<< PartitioningForStatement m_partitioning; ======= String m_sql; String m_stmtName; String m_procName; PlanAssembler m_assembler; >>>>>>> String m_sql; String m_stmtName; String m_procName; <<<<<<< //m_quietPlanner = suppressDebugOutput; //m_fullDebug = System.getProperties().contains("compilerdebug"); m_quietPlanner = false; m_fullDebug = true; ======= m_quietPlanner = suppressDebugOutput; m_fullDebug = System.getProperties().contains("compilerdebug"); m_quietPlanner = suppressDebugOutput; m_partitioning = partitioning; m_maxTablesPerJoin = maxTablesPerJoin; m_costModel = costModel; m_paramHints = paramHints; m_joinOrder = joinOrder; >>>>>>> m_partitioning = partitioning; m_maxTablesPerJoin = maxTablesPerJoin; m_costModel = costModel; m_paramHints = paramHints; m_joinOrder = joinOrder; m_planSelector = new PlanSelector(m_cluster, m_db, m_estimates, m_stmtName, m_procName, m_sql, m_costModel, m_paramHints, suppressDebugOutput, System.getProperties().contains("compilerdebug")); <<<<<<< // Init PlanProcessor PlanSelector planSelector = new PlanSelector(m_cluster, m_db, m_estimates, stmtName, procName, sql, costModel, paramHints, m_quietPlanner, m_fullDebug); planSelector.outputCompiledStatement(xmlSQL); // Init Assembler PlanAssembler assembler = new PlanAssembler(m_cluster, m_db, m_partitioning, planSelector); ======= if (!m_quietPlanner && m_fullDebug) { outputCompiledStatement(m_xmlSQL); } } /** * Auto-parameterize all of the literals in the parsed SQL statement. * * @return An opaque token representing the parsed statement with (possibly) parameterization. */ public String parameterize() { m_paramzInfo = ParameterizationInfo.parameterize(m_xmlSQL); // skip plans with pre-existing parameters and plans that don't parameterize // assume a user knows how to cache/optimize these if (m_paramzInfo != null) { // if requested output the second version of the parsed plan if (!m_quietPlanner && m_fullDebug) { outputParameterizedCompiledStatement(m_paramzInfo.parameterizedXmlSQL); } return m_paramzInfo.parameterizedXmlSQL.toMinString(); } >>>>>>> m_planSelector.outputCompiledStatement(m_xmlSQL); } /** * Auto-parameterize all of the literals in the parsed SQL statement. * * @return An opaque token representing the parsed statement with (possibly) parameterization. */ public String parameterize() { m_paramzInfo = ParameterizationInfo.parameterize(m_xmlSQL); // skip plans with pre-existing parameters and plans that don't parameterize // assume a user knows how to cache/optimize these if (m_paramzInfo != null) { // if requested output the second version of the parsed plan m_planSelector.outputParameterizedCompiledStatement(m_paramzInfo.parameterizedXmlSQL); return m_paramzInfo.parameterizedXmlSQL.toMinString(); } <<<<<<< public String getErrorMessage() { return m_recentErrorMsg; } ======= /** * @param stmtName * @param procName * @param plan * @param filename */ private void outputExplainedPlan(CompiledPlan plan, String filename) { BuildDirectoryUtils.writeFile("statement-all-plans/" + m_procName + "_" + m_stmtName, filename + ".txt", plan.explainedPlan); } /** * @param stmtName * @param procName * @param parsedStmt */ private void outputParsedStatement(AbstractParsedStmt parsedStmt) { // output a description of the parsed stmt BuildDirectoryUtils.writeFile("statement-parsed", m_procName + "_" + m_stmtName + ".txt", parsedStmt.toString()); } /** * @param stmtName * @param procName * @param xmlSQL */ private void outputCompiledStatement(VoltXMLElement xmlSQL) { // output the xml from hsql to disk for debugging BuildDirectoryUtils.writeFile("statement-hsql-xml", m_procName + "_" + m_stmtName + ".xml", xmlSQL.toString()); } /** * @param stmtName * @param procName * @param xmlSQL */ private void outputParameterizedCompiledStatement(VoltXMLElement xmlSQL) { // output the xml from hsql to disk for debugging BuildDirectoryUtils.writeFile("statement-hsql-xml", m_procName + "_" + m_stmtName + "-parameterized.xml", xmlSQL.toString()); } /** * @param plan * @param planGraph * @param stmtName * @param procName * @param filename */ private void outputPlanFullDebug(CompiledPlan plan, AbstractPlanNode planGraph, String filename) { // GENERATE JSON DEBUGGING OUTPUT BEFORE WE CLEAN UP THE // PlanColumns // convert a tree into an execution list PlanNodeList nodeList = new PlanNodeList(planGraph); // get the json serialized version of the plan String json = null; try { String crunchJson = nodeList.toJSONString(); //System.out.println(crunchJson); //System.out.flush(); JSONObject jobj = new JSONObject(crunchJson); json = jobj.toString(4); } catch (JSONException e2) { // Any plan that can't be serialized to JSON to // write to debugging output is also going to fail // to get written to the catalog, to sysprocs, etc. // Just bail. m_recentErrorMsg = "Plan for sql: '" + plan.sql + "' can't be serialized to JSON"; // This case used to exit the planner // -- a strange behavior for something that only gets called when full debug output is enabled. // For now, just skip the output and go on to the next plan. return; } // output a description of the parsed stmt json = "PLAN:\n" + json; json = "COST: " + String.valueOf(plan.cost) + "\n" + json; assert (plan.sql != null); json = "SQL: " + plan.sql + "\n" + json; // write json to disk BuildDirectoryUtils.writeFile("statement-all-plans/" + m_procName + "_" + m_stmtName, filename + "-json.txt", json); // create a graph friendly version BuildDirectoryUtils.writeFile("statement-all-plans/" + m_procName + "_" + m_stmtName, filename + ".dot", nodeList.toDOTString("name")); } /** * @param filename * @param filenameRenamed */ private void renameFile(String filename, String filenameRenamed) { File file; File fileRenamed; file = new File(filename); fileRenamed = new File(filenameRenamed); file.renameTo(fileRenamed); } /** * @param stmtName * @param procName * @param bestFilename * @param stats */ private void finalizeOutput(String bestFilename, PlanStatistics stats) { // find out where debugging is going String prefix = BuildDirectoryUtils.getBuildDirectoryPath() + "/" + BuildDirectoryUtils.rootPath + "statement-all-plans/" + m_procName + "_" + m_stmtName + "/"; String winnerFilename, winnerFilenameRenamed; // if outputting full stuff if (m_fullDebug) { // rename the winner json plan winnerFilename = prefix + bestFilename + "-json.txt"; winnerFilenameRenamed = prefix + "WINNER-" + bestFilename + "-json.txt"; renameFile(winnerFilename, winnerFilenameRenamed); // rename the winner dot plan winnerFilename = prefix + bestFilename + ".dot"; winnerFilenameRenamed = prefix + "WINNER-" + bestFilename + ".dot"; renameFile(winnerFilename, winnerFilenameRenamed); } // rename the winner explain plan winnerFilename = prefix + bestFilename + ".txt"; winnerFilenameRenamed = prefix + "WINNER-" + bestFilename + ".txt"; renameFile(winnerFilename, winnerFilenameRenamed); if (m_fullDebug) { // output the plan statistics to disk for debugging BuildDirectoryUtils.writeFile("statement-stats", m_procName + "_" + m_stmtName + ".txt", stats.toString()); } } >>>>>>>
<<<<<<< import java.util.concurrent.Callable; import java.util.concurrent.Executors; ======= >>>>>>> import java.util.concurrent.Callable;
<<<<<<< ======= import android.content.Intent; import android.graphics.Bitmap; >>>>>>> import android.graphics.Bitmap; <<<<<<< iv.setImageResource(MimetypeIconUtil.getFileTypeIconId(mimetype, filename)); ======= Bitmap thumbnail = null; if (file.isImage()) { String tagId = String.valueOf(file.getRemoteId()); thumbnail = ThumbnailsCacheManager.getBitmapFromDiskCache(tagId); } if (thumbnail != null) { // Display thumbnail iv.setImageBitmap(thumbnail); } else { // Name of the file, to deduce the icon to use in case the MIME type is not precise enough String filename = file.getFileName(); iv.setImageResource(DisplayUtils.getFileTypeIconId(mimetype, filename)); } >>>>>>> Bitmap thumbnail = null; if (file.isImage()) { String tagId = String.valueOf(file.getRemoteId()); thumbnail = ThumbnailsCacheManager.getBitmapFromDiskCache(tagId); } if (thumbnail != null) { // Display thumbnail iv.setImageBitmap(thumbnail); } else { // Name of the file, to deduce the icon to use in case the MIME type is not precise enough String filename = file.getFileName(); iv.setImageResource(MimetypeIconUtil.getFileTypeIconId(mimetype, filename)); }
<<<<<<< import java.util.HashSet; import java.util.LinkedHashMap; ======= >>>>>>> import java.util.LinkedHashMap;
<<<<<<< return className.equals("org.voltdb.sysprocs.UpdateApplicationCatalog") || className.equals("org.voltdb.sysprocs.AdHocSP"); ======= return singlePartition; >>>>>>> return singlePartition; <<<<<<< p.setSinglepartition(getSinglepartition()); ======= >>>>>>>
<<<<<<< Distributer dist = new Distributer(false, null, ======= Distributer dist = new Distributer(128, null, false, >>>>>>> Distributer dist = new Distributer(false, <<<<<<< Distributer dist = new Distributer(false, null, ======= Distributer dist = new Distributer(128, null, false, >>>>>>> Distributer dist = new Distributer(false, <<<<<<< Distributer dist = new Distributer( false, null, ======= Distributer dist = new Distributer(128, null, false, >>>>>>> Distributer dist = new Distributer( false,
<<<<<<< ======= @Override protected void onNewIntent (Intent intent) { Log_OC.v(TAG, "onNewIntent() start"); Account current = AccountUtils.getCurrentOwnCloudAccount(this); if (current != null && mAccount != null && !mAccount.name.equals(current.name)) { mAccount = current; } Log_OC.v(TAG, "onNewIntent() stop"); } >>>>>>> @Override protected void onNewIntent (Intent intent) { Log_OC.v(TAG, "onNewIntent() start"); Account current = AccountUtils.getCurrentOwnCloudAccount(this); if (current != null && mAccount != null && !mAccount.name.equals(current.name)) { mAccount = current; } Log_OC.v(TAG, "onNewIntent() stop"); }
<<<<<<< * Wrapper for crashLocalVoltDB() to keep compatibility with >100 calls. * Prefer crashLocalVoltDB() in new code. */ public static void crashVoltDB() { crashLocalVoltDB("Unexpected crash", true, null); } /** ======= >>>>>>>
<<<<<<< import org.voltdb.NodeDRGateway; import org.voltdb.ProcedureRunnerFactory; import org.voltdb.iv2.Site; ======= import org.voltdb.CommandLog; >>>>>>> import org.voltdb.NodeDRGateway; import org.voltdb.ProcedureRunnerFactory; import org.voltdb.iv2.Site; import org.voltdb.CommandLog; <<<<<<< boolean createForRejoin, NodeDRGateway nodeDRGateway) ======= boolean createForRejoin, CommandLog cl) >>>>>>> boolean createForRejoin, CommandLog cl, NodeDRGateway nodeDRGateway)
<<<<<<< import org.voltdb.planner.SubPlanAssembler; ======= import org.voltdb.planner.ParsedSelectStmt; >>>>>>> import org.voltdb.planner.ParsedSelectStmt; import org.voltdb.planner.SubPlanAssembler;
<<<<<<< import org.voltdb.messaging.Iv2LogFaultMessage; import org.voltdb.SnapshotCompletionInterest; import org.voltdb.SnapshotCompletionMonitor; ======= import org.voltdb.CommandLog.DurabilityListener; >>>>>>> import org.voltdb.CommandLog.DurabilityListener; import org.voltdb.messaging.Iv2LogFaultMessage; import org.voltdb.SnapshotCompletionInterest; import org.voltdb.SnapshotCompletionMonitor; <<<<<<< private final SnapshotCompletionMonitor m_snapMonitor; // Need to track when command log replay is complete (even if not performed) so that // we know when we can start writing viable replay sets to the fault log. boolean m_replayComplete = false; ======= private final DurabilityListener m_durabilityListener; >>>>>>> private final SnapshotCompletionMonitor m_snapMonitor; // Need to track when command log replay is complete (even if not performed) so that // we know when we can start writing viable replay sets to the fault log. boolean m_replayComplete = false; private final DurabilityListener m_durabilityListener; <<<<<<< SpScheduler(int partitionId, SiteTaskerQueue taskQueue, SnapshotCompletionMonitor snapMonitor) ======= SpScheduler(int partitionId, final SiteTaskerQueue taskQueue) >>>>>>> SpScheduler(int partitionId, SiteTaskerQueue taskQueue, SnapshotCompletionMonitor snapMonitor) <<<<<<< m_snapMonitor = snapMonitor; } public void setLeaderState(boolean isLeader) { super.setLeaderState(isLeader); m_snapMonitor.addInterest(this); } public void setMaxSeenTxnId(long maxSeenTxnId) { super.setMaxSeenTxnId(maxSeenTxnId); writeIv2ViableReplayEntry(); ======= m_durabilityListener = new DurabilityListener() { @Override public void onDurability(ArrayDeque<Object> durableThings) { synchronized (m_lock) { for (Object o : durableThings) { m_pendingTasks.offer((TransactionTask)o); } } } }; >>>>>>> m_snapMonitor = snapMonitor; m_durabilityListener = new DurabilityListener() { @Override public void onDurability(ArrayDeque<Object> durableThings) { synchronized (m_lock) { for (Object o : durableThings) { m_pendingTasks.offer((TransactionTask)o); } } } }; } public void setLeaderState(boolean isLeader) { super.setLeaderState(isLeader); m_snapMonitor.addInterest(this); } public void setMaxSeenTxnId(long maxSeenTxnId) { super.setMaxSeenTxnId(maxSeenTxnId); writeIv2ViableReplayEntry();
<<<<<<< m_scheduler.forwardPendingTaskToRejoinNode(replicasAdded, snapshotSaveTxnId); ======= ((SpScheduler) m_scheduler).forwardPendingTaskToRejoinNode(replicasAdded, snapshotTransactionState.m_spHandle); >>>>>>> m_scheduler.forwardPendingTaskToRejoinNode(replicasAdded, snapshotTransactionState.m_spHandle);
<<<<<<< /** * Get all normal tables from the catalog. A normal table is one that's NOT a materialized * view, nor an export table. For the lack of a better name, I call it normal. * @param catalog Catalog database * @param isReplicated true to return only replicated tables, * false to return all partitioned tables * @return A list of tables */ public static List<Table> getNormalTables(Database catalog, boolean isReplicated) { List<Table> tables = new ArrayList<Table>(); for (Table table : catalog.getTables()) { if ((table.getIsreplicated() == isReplicated) && table.getMaterializer() == null && !CatalogUtil.isTableExportOnly(catalog, table)) { tables.add(table); } } return tables; } ======= // Calculate the width of an index: // -- if the index is a pure-column index, return number of columns in the index // -- if the index is an expression index, return number of expressions used to create the index public static int getCatalogIndexSize(Index index) { int indexSize = 0; String jsonstring = index.getExpressionsjson(); if (jsonstring.isEmpty()) { indexSize = getSortedCatalogItems(index.getColumns(), "index").size(); } else { try { indexSize = AbstractExpression.fromJSONArrayString(jsonstring, null).size(); } catch (JSONException e) { // TODO Auto-generated catch block e.printStackTrace(); } } return indexSize; } >>>>>>> /** * Get all normal tables from the catalog. A normal table is one that's NOT a materialized * view, nor an export table. For the lack of a better name, I call it normal. * @param catalog Catalog database * @param isReplicated true to return only replicated tables, * false to return all partitioned tables * @return A list of tables */ public static List<Table> getNormalTables(Database catalog, boolean isReplicated) { List<Table> tables = new ArrayList<Table>(); for (Table table : catalog.getTables()) { if ((table.getIsreplicated() == isReplicated) && table.getMaterializer() == null && !CatalogUtil.isTableExportOnly(catalog, table)) { tables.add(table); } } return tables; } // Calculate the width of an index: // -- if the index is a pure-column index, return number of columns in the index // -- if the index is an expression index, return number of expressions used to create the index public static int getCatalogIndexSize(Index index) { int indexSize = 0; String jsonstring = index.getExpressionsjson(); if (jsonstring.isEmpty()) { indexSize = getSortedCatalogItems(index.getColumns(), "index").size(); } else { try { indexSize = AbstractExpression.fromJSONArrayString(jsonstring, null).size(); } catch (JSONException e) { // TODO Auto-generated catch block e.printStackTrace(); } } return indexSize; }
<<<<<<< /** * Get optimized configuration data for wire serialization. * @return optimized configuration data * @throws IOException */ public static synchronized HashinatorSnapshotData serializeConfiguredHashinator() throws IOException { HashinatorSnapshotData optimizedSerializationData = null; Pair<Long, ? extends TheHashinator> currentInstance = instance.get(); switch (getConfiguredHashinatorType()) { case LEGACY: break; case ELASTIC: { if (optimizedSerializationDataCache.get() == null) { byte[] serData = currentInstance.getSecond().serializeCooked(); optimizedSerializationDataCache.set(new HashinatorSnapshotData(serData, currentInstance.getFirst())); } optimizedSerializationData = optimizedSerializationDataCache.get(); break; } } return optimizedSerializationData; } /** * Update the current configured hashinator class. Used by snapshot restore. * @param version * @param config * @return config data after unpacking */ public static byte[] deserializeConfiguredHashinator(long version, byte config[]) { return deserializeHashinator(getConfiguredHashinatorClass(), version, config, true); } ======= public static Pair<Long, byte[]> getCurrentVersionedConfig() { Pair<Long, ? extends TheHashinator> currentHashinator = instance.get(); return Pair.of(currentHashinator.getFirst(), currentHashinator.getSecond().pGetCurrentConfig().getSecond()); } >>>>>>> /** * Get optimized configuration data for wire serialization. * @return optimized configuration data * @throws IOException */ public static synchronized HashinatorSnapshotData serializeConfiguredHashinator() throws IOException { HashinatorSnapshotData optimizedSerializationData = null; Pair<Long, ? extends TheHashinator> currentInstance = instance.get(); switch (getConfiguredHashinatorType()) { case LEGACY: break; case ELASTIC: { if (optimizedSerializationDataCache.get() == null) { byte[] serData = currentInstance.getSecond().serializeCooked(); optimizedSerializationDataCache.set(new HashinatorSnapshotData(serData, currentInstance.getFirst())); } optimizedSerializationData = optimizedSerializationDataCache.get(); break; } } return optimizedSerializationData; } /** * Update the current configured hashinator class. Used by snapshot restore. * @param version * @param config * @return config data after unpacking */ public static byte[] deserializeConfiguredHashinator(long version, byte config[]) { return deserializeHashinator(getConfiguredHashinatorClass(), version, config, true); } public static Pair<Long, byte[]> getCurrentVersionedConfig() { Pair<Long, ? extends TheHashinator> currentHashinator = instance.get(); return Pair.of(currentHashinator.getFirst(), currentHashinator.getSecond().pGetCurrentConfig().getSecond()); }
<<<<<<< if (jsObj.has("format")) { m_format = ExportFormat.valueOf(jsObj.getString("format")); } else { m_format = ExportFormat.FOURDOTFOUR; } ======= try { m_partitionColumnName = jsObj.getString("partitionColumnName"); } catch (Exception ex) { //Ignore these if we have a OLD ad file these may not exist. } >>>>>>> if (jsObj.has("format")) { m_format = ExportFormat.valueOf(jsObj.getString("format")); } else { m_format = ExportFormat.FOURDOTFOUR; } try { m_partitionColumnName = jsObj.getString("partitionColumnName"); } catch (Exception ex) { //Ignore these if we have a OLD ad file these may not exist. } <<<<<<< stringer.key("format").value(ExportFormat.FOURDOTFOUR.toString()); ======= stringer.key("partitionColumnName").value(m_partitionColumnName); >>>>>>> stringer.key("format").value(ExportFormat.FOURDOTFOUR.toString()); stringer.key("partitionColumnName").value(m_partitionColumnName);
<<<<<<< import org.voltdb.NodeDRGateway; ======= import org.voltdb.CommandLog; >>>>>>> import org.voltdb.NodeDRGateway; import org.voltdb.CommandLog; <<<<<<< boolean createForRejoin, NodeDRGateway nodeDRGateway) ======= boolean createForRejoin, CommandLog cl) >>>>>>> boolean createForRejoin, CommandLog cl, NodeDRGateway nodeDRGateway)
<<<<<<< // check for conflicting DDL create/drop table statements. // unhappy if the intersection is empty conflictTables.retainAll(createdTables); if (!conflictTables.isEmpty()) { StringBuilder sb = new StringBuilder(); sb.append("AdHoc DDL contains both DROP and CREATE statements for the following table(s):"); for (String tableName : conflictTables) { sb.append(" "); sb.append(tableName); } sb.append("\nYou cannot DROP and ADD a table with the same name in a single batch " + "(via @AdHoc). Issue the DROP and ADD statements as separate commands."); AsyncCompilerResult errResult = AsyncCompilerResult.makeErrorResult(w, sb.toString()); w.completionHandler.onCompletion(errResult); return; } // Is it forbidden by the replication role and configured schema change method? // master and UAC method chosen: if (!w.onReplica && !w.useAdhocDDL) { ======= // Is it configured schema change method? // UAC method chosen: if (!w.useAdhocDDL) { >>>>>>> // check for conflicting DDL create/drop table statements. // unhappy if the intersection is empty conflictTables.retainAll(createdTables); if (!conflictTables.isEmpty()) { StringBuilder sb = new StringBuilder(); sb.append("AdHoc DDL contains both DROP and CREATE statements for the following table(s):"); for (String tableName : conflictTables) { sb.append(" "); sb.append(tableName); } sb.append("\nYou cannot DROP and ADD a table with the same name in a single batch " + "(via @AdHoc). Issue the DROP and ADD statements as separate commands."); AsyncCompilerResult errResult = AsyncCompilerResult.makeErrorResult(w, sb.toString()); w.completionHandler.onCompletion(errResult); return; } // Is it configured schema change method? // UAC method chosen: if (!w.useAdhocDDL) {
<<<<<<< // Prepare for the mv based distributed query fix only if it might be required. if (stmtCache.size() == 1) { // Do not handle joined query case case. StmtTableScan mvTableScan = stmtCache.get(0); Set<SchemaColumn> scanColumns = mvTableScan.m_scanColumns; Set<SchemaColumn> mvNewScanColumns = new HashSet<SchemaColumn>(); // For a COUNT(*)-only scan, scanColumns doesn't not exist. if (scanColumns != null) { mvNewScanColumns.addAll(scanColumns); } processMVBasedQueryFix(mvFixInfo, m_db, mvTableScan, mvNewScanColumns, joinTree); } } private static void processMVBasedQueryFix(MVFixInfo mvFixInfo, Database db, StmtTableScan mvTableScan, Set<SchemaColumn> mvNewScanColumns, JoinNode joinTree) { // Check valid cases first Table mvTable = mvTableScan.m_table; String mvTableName = mvTable.getTypeName(); Table srcTable = mvTable.getMaterializer(); if (srcTable == null) { return; } Column partitionCol = srcTable.getPartitioncolumn(); if (partitionCol == null) { return; } String partitionColName = partitionCol.getName(); MaterializedViewInfo mvInfo = srcTable.getViews().get(mvTableName); // Justify whether partition column is in group by column list or not boolean partitionColInGroupbyCols = false; int numOfGroupByColumns; String complexGroupbyJson = mvInfo.getGroupbyexpressionsjson(); if (complexGroupbyJson.length() > 0) { List<AbstractExpression> mvComplexGroupbyCols = null; try { mvComplexGroupbyCols = AbstractExpression.fromJSONArrayString(complexGroupbyJson); } catch (JSONException e) { e.printStackTrace(); } numOfGroupByColumns = mvComplexGroupbyCols.size(); for (AbstractExpression expr: mvComplexGroupbyCols) { if (expr instanceof TupleValueExpression) { TupleValueExpression tve = (TupleValueExpression) expr; if (tve.getColumnName().equals(partitionColName)) { partitionColInGroupbyCols = true; break; } } } } else { CatalogMap<ColumnRef> mvSimpleGroupbyCols = mvInfo.getGroupbycols(); numOfGroupByColumns = mvSimpleGroupbyCols.size(); for (ColumnRef colRef: mvSimpleGroupbyCols) { if (colRef.getColumn().getName().equals(partitionColName)) { partitionColInGroupbyCols = true; break; } } } assert(numOfGroupByColumns > 0); if (partitionColInGroupbyCols) { // Group by columns contain partition column from source table. // Then, query on mv table will have duplicates from each partition. // There is no need to fix this case, so just return. return; } // Start to do real processing now. mvFixInfo.needed = true; mvFixInfo.mvTable = mvTable; Set<SchemaColumn> mvDDLGroupbyColumns = new HashSet<SchemaColumn>(); Map<String, ExpressionType> mvColumnAggType = new HashMap<String, ExpressionType>(); List<Column> mvColumnArray = CatalogUtil.getSortedCatalogItems(mvFixInfo.mvTable.getColumns(), "index"); for (Column mvCol: mvColumnArray) { ExpressionType reAggType = ExpressionType.get(mvCol.getAggregatetype()); if (reAggType == ExpressionType.AGGREGATE_COUNT_STAR || reAggType == ExpressionType.AGGREGATE_COUNT) { reAggType = ExpressionType.AGGREGATE_SUM; } mvColumnAggType.put(mvCol.getName(), reAggType); } NodeSchema inlineProjSchema = new NodeSchema(); // construct new projection columns for scan plan node. for (SchemaColumn scol: mvNewScanColumns) { inlineProjSchema.addColumn(scol); } for (int i = 0; i < numOfGroupByColumns; i++) { Column mvCol = mvColumnArray.get(i); String colName = mvCol.getName(); TupleValueExpression tve = new TupleValueExpression(mvTableName, mvTableScan.m_tableAlias, colName, colName, i); tve.setValueType(VoltType.get((byte)mvCol.getType())); tve.setValueSize(mvCol.getSize()); SchemaColumn scol = new SchemaColumn(mvTableName, mvTableScan.m_tableAlias, colName, colName, tve); mvDDLGroupbyColumns.add(scol); if (!mvNewScanColumns.contains(scol)) { mvNewScanColumns.add(scol); // construct new projection columns for scan plan node. inlineProjSchema.addColumn(scol); } } mvFixInfo.scanInlinedProjectionNode = new ProjectionPlanNode(); mvFixInfo.scanInlinedProjectionNode.setOutputSchema(inlineProjSchema); // Construct the reAggregation plan node's aggSchema mvFixInfo.reAggNode = new HashAggregatePlanNode(); int outputColumnIndex = 0; NodeSchema aggSchema = new NodeSchema(); // Construct reAggregation node's aggregation and group by list. for (SchemaColumn scol: mvNewScanColumns) { if (mvDDLGroupbyColumns.contains(scol)) { // Add group by expression. mvFixInfo.reAggNode.addGroupByExpression(scol.getExpression()); } else { ExpressionType reAggType = mvColumnAggType.get(scol.getColumnName()); assert(reAggType != null); AbstractExpression agg_input_expr = scol.getExpression(); assert(agg_input_expr instanceof TupleValueExpression); // Add aggregation information. mvFixInfo.reAggNode.addAggregate(reAggType, false, outputColumnIndex, agg_input_expr); } aggSchema.addColumn(scol); outputColumnIndex++; } mvFixInfo.reAggNode.setOutputSchema(aggSchema); assert(joinTree != null); assert(joinTree.m_whereExpr == null); // Follow HSQL's logic to store the where expression in joinExpr for single table. AbstractExpression where = joinTree.m_joinExpr; if (where != null) { // Collect all TVEs that need to be do re-aggregation in coordinator. List<TupleValueExpression> needReAggTVEs = new ArrayList<TupleValueExpression>(); for (int i=numOfGroupByColumns; i < mvColumnArray.size(); i++) { Column mvCol = mvColumnArray.get(i); TupleValueExpression tve = new TupleValueExpression(mvTableName, mvTableScan.m_tableAlias, mvCol.getName(), mvCol.getName(), i); needReAggTVEs.add(tve); } List<AbstractExpression> exprs = ExpressionUtil.uncombine(where); List<AbstractExpression> pushdownExprs = new ArrayList<AbstractExpression>(); List<AbstractExpression> aggPostExprs = new ArrayList<AbstractExpression>(); // Check where clause. for (AbstractExpression expr: exprs) { ArrayList<AbstractExpression> tves = expr.findBaseTVEs(); boolean pushdown = true; for (TupleValueExpression needReAggTVE: needReAggTVEs) { if (tves.contains(needReAggTVE)) { pushdown = false; break; } } if (pushdown) { pushdownExprs.add(expr); } else { aggPostExprs.add(expr); } } AbstractExpression aggPostExpr = ExpressionUtil.combine(aggPostExprs); mvFixInfo.reAggNode.setPostPredicate(aggPostExpr); assert(joinTree.m_whereExpr == null); joinTree.m_joinExpr = ExpressionUtil.combine(pushdownExprs); } ======= >>>>>>>
<<<<<<< import android.os.Parcelable; import android.preference.PreferenceManager; ======= import android.support.v4.view.GravityCompat; >>>>>>> import android.os.Parcelable; import android.preference.PreferenceManager; import android.support.v4.view.GravityCompat; <<<<<<< } else if (component.equals(new ComponentName(PreviewImageActivity.this, FileUploadService.class))) { ======= } else if (component.equals(new ComponentName(PreviewImageActivity.this, FileUploader.class))) { >>>>>>> } else if (component.equals(new ComponentName(PreviewImageActivity.this, FileUploadService.class))) { <<<<<<< } else if (component.equals(new ComponentName(PreviewImageActivity.this, FileUploadService.class))) { ======= } else if (component.equals(new ComponentName(PreviewImageActivity.this, FileUploader.class))) { >>>>>>> } else if (component.equals(new ComponentName(PreviewImageActivity.this, FileUploadService.class))) { <<<<<<< showDetailsIntent.putExtra(FileActivity.EXTRA_FILE, (Parcelable)file); showDetailsIntent.putExtra(FileActivity.EXTRA_ACCOUNT, AccountUtils.getCurrentOwnCloudAccount(this)); ======= showDetailsIntent.putExtra(FileActivity.EXTRA_FILE, file); showDetailsIntent.putExtra(FileActivity.EXTRA_ACCOUNT, AccountUtils.getCurrentOwnCloudAccount(this)); >>>>>>> showDetailsIntent.putExtra(FileActivity.EXTRA_FILE, (Parcelable)file); showDetailsIntent.putExtra(FileActivity.EXTRA_ACCOUNT, AccountUtils.getCurrentOwnCloudAccount(this));
<<<<<<< private PBDRetentionPolicy m_retentionPolicy; private Boolean m_requiresId; ======= private Executor m_deferredDeleter = Runnable::run; >>>>>>> private Executor m_deferredDeleter = Runnable::run; private PBDRetentionPolicy m_retentionPolicy; private Boolean m_requiresId; <<<<<<< @Override public void setRetentionPolicy(RetentionPolicyType policyType, Object... params) { assert(m_retentionPolicy == null); m_retentionPolicy = RetentionPolicyMgr.getInstance().addRetentionPolicy(policyType, this, params); } @Override public void startRetentionPolicyEnforcement() { try { if (m_retentionPolicy != null) { m_retentionPolicy.startPolicyEnforcement(); } } catch(IOException e) { // Unexpected error. Hence runtime error throw new RuntimeException(e); } } ======= @Override public void registerDeferredDeleter(Executor deferredDeleter) { m_deferredDeleter = (deferredDeleter == null) ? Runnable::run : deferredDeleter; } >>>>>>> @Override public void registerDeferredDeleter(Executor deferredDeleter) { m_deferredDeleter = (deferredDeleter == null) ? Runnable::run : deferredDeleter; } @Override public void setRetentionPolicy(RetentionPolicyType policyType, Object... params) { assert(m_retentionPolicy == null); m_retentionPolicy = RetentionPolicyMgr.getInstance().addRetentionPolicy(policyType, this, params); } @Override public void startRetentionPolicyEnforcement() { try { if (m_retentionPolicy != null) { m_retentionPolicy.startPolicyEnforcement(); } } catch(IOException e) { // Unexpected error. Hence runtime error throw new RuntimeException(e); } }
<<<<<<< ======= import org.voltdb.iv2.Site; >>>>>>> <<<<<<< ======= final SpTransactionState m_txn; >>>>>>> <<<<<<< m_txn = txn; ======= m_txn = new SpTransactionState(txnId, msg); >>>>>>> m_txn = txn;
<<<<<<< private final boolean sql; private final boolean sqlread; private final boolean sysproc; ======= private final boolean adhoc; private final boolean admin; >>>>>>> private final boolean sql; private final boolean sqlread; private final boolean admin; <<<<<<< if(info.sql || info.sqlread || info.defaultproc || info.sysproc || info.defaultprocread) { ======= if(info.adhoc || info.defaultproc || info.admin || info.defaultprocread) { >>>>>>> if(info.sql || info.sqlread || info.defaultproc || info.admin || info.defaultprocread) {
<<<<<<< gi[0] = new GroupInfo("group1", true, true, true, true, true); ======= gi[0] = new GroupInfo("group1", true, true, true, true, false); >>>>>>> gi[0] = new GroupInfo("group1", true, true, true, true, true, false); <<<<<<< gi[0] = new GroupInfo("group1", true, true, true, true, false); ======= gi[0] = new GroupInfo("group1", true, true, true, false, false); >>>>>>> gi[0] = new GroupInfo("group1", true, true, true, true, false, false); <<<<<<< gi[0] = new GroupInfo("group1", true, true, true, true, false); ======= gi[0] = new GroupInfo("group1", true, true, true, false, false); >>>>>>> gi[0] = new GroupInfo("group1", true, true, true, true, false, false); <<<<<<< gi[0] = new GroupInfo("group1", true, true, true, true, false); ======= gi[0] = new GroupInfo("group1", true, true, true, false, false); >>>>>>> gi[0] = new GroupInfo("group1", true, true, true, true, false, false); <<<<<<< gi[0] = new GroupInfo("group1", true, true, true, true, false); gi[1] = new GroupInfo("group2", true, true, true, true, false); ======= gi[0] = new GroupInfo("group1", true, true, true, false, false); gi[1] = new GroupInfo("group2", true, true, true, false, true); >>>>>>> gi[0] = new GroupInfo("group1", true, true, true, true, false, false); gi[1] = new GroupInfo("group2", true, true, true, true, false, true); <<<<<<< gi[0] = new GroupInfo("group1", true, true, true, true, false); gi[1] = new GroupInfo("group2", true, true, true, true, false); ======= gi[0] = new GroupInfo("group1", true, true, true, false, true); gi[1] = new GroupInfo("group2", true, true, true, false, false); >>>>>>> gi[0] = new GroupInfo("group1", true, true, true, true, false, true); gi[1] = new GroupInfo("group2", true, true, true, true, false, false); <<<<<<< gi[0] = new GroupInfo("group1", true, true, true, true, false); gi[1] = new GroupInfo("group2", true, true, true, true, false); ======= gi[0] = new GroupInfo("group1", true, true, true, false, false); gi[1] = new GroupInfo("group2", true, true, true, false, false); >>>>>>> gi[0] = new GroupInfo("group1", true, true, true, true, false, false); gi[1] = new GroupInfo("group2", true, true, true, true, false, false);
<<<<<<< private final double m_latitude; private final double m_longitude; private static final int BYTES_IN_A_COORD = Double.SIZE / 8; ======= // // It's slightly hard to see this in the actual pattern // definition, but the pattern we want to match, ignoring space, is: // 1. Some optional space. // 2. The word "point", case insensitive. // 3. Some optional space. // 4. A left parenthesis. // 5. Some optional space. // 6. A coordinate, consisting of // 6.1. An optional sign. // 6.2. A digit string, starting with [1-9]. // 6.3. An optional dot followed by a floating point string. // 7. Some required space. // 8. A second coordinate, just like (6) above // 9. A right parenthesis. // 10. Some optional space. // 11. The end of the string. // private static final Pattern wktPattern = Pattern.compile("^\\s*point\\s*[(]\\s*([-]?[1-9]\\d*)(?:[.](\\d*))?\\s+([-]?[1-9]\\d*)(?:[.](\\d*))?\\s*[)]\\s*\\z", Pattern.CASE_INSENSITIVE); // Internal representation of a geospatial point // is subject to change. For now, just use two floats. // This matches the EE representation. private final float m_latitude; private final float m_longitude; // In the default constructor, initialize to the null point // (defined as either value being NaN) public PointType() { m_latitude = Float.NaN; m_longitude = Float.NaN; } >>>>>>> // // It's slightly hard to see this in the actual pattern // definition, but the pattern we want to match, ignoring space, is: // 1. Some optional space. // 2. The word "point", case insensitive. // 3. Some optional space. // 4. A left parenthesis. // 5. Some optional space. // 6. A coordinate, consisting of // 6.1. An optional sign. // 6.2. A digit string, starting with [1-9]. // 6.3. An optional dot followed by a floating point string. // 7. Some required space. // 8. A second coordinate, just like (6) above // 9. A right parenthesis. // 10. Some optional space. // 11. The end of the string. // private static final Pattern wktPattern = Pattern.compile("^\\s*point\\s*[(]\\s*([-]?[1-9]\\d*)(?:[.](\\d*))?\\s+([-]?[1-9]\\d*)(?:[.](\\d*))?\\s*[)]\\s*\\z", Pattern.CASE_INSENSITIVE); private final double m_latitude; private final double m_longitude; private static final int BYTES_IN_A_COORD = Double.SIZE / 8; <<<<<<< if (m_latitude < -90.0 || m_latitude > 90.0) { throw new IllegalArgumentException("Latitude out of range in PointType constructor"); } if (m_longitude < -180.0 || m_longitude > 180.0) { throw new IllegalArgumentException("Longitude out of range in PointType constructor"); } ======= private static float toFloat(String aInt, String aFrac) { return Float.parseFloat(aInt + "." + (aFrac == null ? "0" : aFrac)); } /** * Create a PointType from a WellKnownText string. * @param param */ public static PointType pointFromText(String param) { if (param == null) { throw new IllegalArgumentException("Null well known text argument to PointType constructor."); } Matcher m = wktPattern.matcher(param); if (m.find()) { float latitude = toFloat(m.group(1), m.group(2)); float longitude = toFloat(m.group(3), m.group(4)); if (Math.abs(latitude) > 90.0) { throw new IllegalArgumentException(String.format("Latitude \"%f\" out of bounds.", latitude)); } if (Math.abs(longitude) > 180.0) { throw new IllegalArgumentException(String.format("Longitude \"%f\" out of bounds.", longitude)); } return new PointType(latitude, longitude); } else { throw new IllegalArgumentException("Cannot construct PointType value from \"" + param + "\""); } } public boolean isNull() { return Float.isNaN(m_latitude) || Float.isNaN(m_longitude); >>>>>>> if (m_latitude < -90.0 || m_latitude > 90.0) { throw new IllegalArgumentException("Latitude out of range in PointType constructor"); } } private static float toFloat(String aInt, String aFrac) { return Float.parseFloat(aInt + "." + (aFrac == null ? "0" : aFrac)); } /** * Create a PointType from a WellKnownText string. * @param param */ public static PointType pointFromText(String param) { if (param == null) { throw new IllegalArgumentException("Null well known text argument to PointType constructor."); } Matcher m = wktPattern.matcher(param); if (m.find()) { float latitude = toFloat(m.group(1), m.group(2)); float longitude = toFloat(m.group(3), m.group(4)); if (Math.abs(latitude) > 90.0) { throw new IllegalArgumentException(String.format("Latitude \"%f\" out of bounds.", latitude)); } if (Math.abs(longitude) > 180.0) { throw new IllegalArgumentException(String.format("Longitude \"%f\" out of bounds.", longitude)); } return new PointType(latitude, longitude); } else { throw new IllegalArgumentException("Cannot construct PointType value from \"" + param + "\""); }
<<<<<<< if (failedSites.contains(entry.getValue().m_sourceHSId)) { recoveryLog.fatal("Node fault during recovery of Site " + m_HSId + " resulted in source Site " + entry.getValue().m_sourceHSId + " becoming unavailable. Failing recovering node."); VoltDB.crashVoltDB(); ======= if (failedSites.contains(entry.getValue().m_sourceSiteId)) { VoltDB.crashLocalVoltDB("Node fault during recovery of Site " + m_siteId + " resulted in source Site " + entry.getValue().m_sourceSiteId + " becoming unavailable. Failing recovering node.", false, null); >>>>>>> if (failedSites.contains(entry.getValue().m_sourceHSId)) { VoltDB.crashLocalVoltDB("Node fault during recovery of Site " + m_HSId + " resulted in source Site " + entry.getValue().m_sourceHSId + " becoming unavailable. Failing recovering node.", false, null); <<<<<<< recoveryLog.fatal("Could not find a source site for HSId " + HSId + " partition id " + partitionId); VoltDB.crashVoltDB(); ======= VoltDB.crashLocalVoltDB("Could not find a source site for siteId " + siteId + " partition id " + partitionId, false, null); >>>>>>> VoltDB.crashLocalVoltDB("Could not find a source site for HSId " + HSId + " partition id " + partitionId, false, null);
<<<<<<< } else if (arg.equalsIgnoreCase("datasourcecluster")) { m_datasourceClusterId = Byte.parseByte(args[++i]); if (m_datasourceClusterId < 0) { throw new IllegalArgumentException("Invalid data cluster id value: " + m_datasourceClusterId + ". Data source cluster id must be >= 0"); } } else { ======= } else if (arg.equalsIgnoreCase("getvoltdbroot")) { //Can not use voltdbroot which creates directory we dont intend to create for get deployment etc. m_voltdbRoot = new VoltFile(args[++i]); } else if (arg.equalsIgnoreCase("get")) { m_startAction = StartAction.GET; GetActionArgument.valueOf(args[++i].trim().toUpperCase()); } else if (arg.equalsIgnoreCase("file")) { m_getOutput = args[++i].trim(); } else { >>>>>>> } else if (arg.equalsIgnoreCase("datasourcecluster")) { m_datasourceClusterId = Byte.parseByte(args[++i]); if (m_datasourceClusterId < 0) { throw new IllegalArgumentException("Invalid data cluster id value: " + m_datasourceClusterId + ". Data source cluster id must be >= 0"); } } else if (arg.equalsIgnoreCase("getvoltdbroot")) { //Can not use voltdbroot which creates directory we dont intend to create for get deployment etc. m_voltdbRoot = new VoltFile(args[++i]); } else if (arg.equalsIgnoreCase("get")) { m_startAction = StartAction.GET; GetActionArgument.valueOf(args[++i].trim().toUpperCase()); } else if (arg.equalsIgnoreCase("file")) { m_getOutput = args[++i].trim(); } else {
<<<<<<< case HTTP: exportClientClassName = "org.voltdb.exportclient.HttpExportClient"; break; ======= case RABBITMQ: exportClientClassName = "org.voltdb.exportclient.RabbitMQExportClient"; break; >>>>>>> case RABBITMQ: exportClientClassName = "org.voltdb.exportclient.RabbitMQExportClient"; break; case HTTP: exportClientClassName = "org.voltdb.exportclient.HttpExportClient"; break;
<<<<<<< if (VoltDB.instance().isIV2Enabled()) { long handle = m_ciHandles.getHandle(isSinglePartition, partitions[0], invocation.getClientHandle(), (Connection)clientData, adminConnection, messageSize, now); try { long initiatorHSId; if (isSinglePartition) { JSONObject master = m_iv2Masters.get(Integer.toString(partitions[0])); if (master == null) { hostLog.error("Failed to find master initiator for partition: " + Integer.toString(partitions[0]) + ". Transaction not initiated."); m_ciHandles.removeHandle(handle); return false; } initiatorHSId = master.getLong("hsid"); } else { initiatorHSId = m_cartographer.getHSIdForMultiPartitionInitiator(); } Iv2InitiateTaskMessage workRequest = new Iv2InitiateTaskMessage(m_siteId, initiatorHSId, Iv2InitiateTaskMessage.UNUSED_MP_TXNID, isReadOnly, isSinglePartition, invocation, handle); Iv2Trace.logCreateTransaction(workRequest); m_mailbox.send(initiatorHSId, workRequest); } catch (JSONException e) { m_ciHandles.removeHandle(handle); throw new RuntimeException(e); } m_backpressure.increaseBackpressure(messageSize); return true; } else { return m_initiator.createTransaction(connectionId, connectionHostname, adminConnection, invocation, isReadOnly, isSinglePartition, isEveryPartition, partitions, numPartitions, clientData, messageSize, now); } ======= return m_initiator.createTransaction( connectionId, connectionHostname, adminConnection, invocation, isReadOnly, isSinglePartition, isEveryPartition, partitions, numPartitions, clientData, messageSize, now, allowMismatchedResults); >>>>>>> if (VoltDB.instance().isIV2Enabled()) { long handle = m_ciHandles.getHandle(isSinglePartition, partitions[0], invocation.getClientHandle(), (Connection)clientData, adminConnection, messageSize, now); try { long initiatorHSId; if (isSinglePartition) { JSONObject master = m_iv2Masters.get(Integer.toString(partitions[0])); if (master == null) { hostLog.error("Failed to find master initiator for partition: " + Integer.toString(partitions[0]) + ". Transaction not initiated."); m_ciHandles.removeHandle(handle); return false; } initiatorHSId = master.getLong("hsid"); } else { initiatorHSId = m_cartographer.getHSIdForMultiPartitionInitiator(); } Iv2InitiateTaskMessage workRequest = new Iv2InitiateTaskMessage(m_siteId, initiatorHSId, Iv2InitiateTaskMessage.UNUSED_MP_TXNID, isReadOnly, isSinglePartition, invocation, handle); Iv2Trace.logCreateTransaction(workRequest); m_mailbox.send(initiatorHSId, workRequest); } catch (JSONException e) { m_ciHandles.removeHandle(handle); throw new RuntimeException(e); } m_backpressure.increaseBackpressure(messageSize); return true; } else { return m_initiator.createTransaction(connectionId, connectionHostname, adminConnection, invocation, isReadOnly, isSinglePartition, isEveryPartition, partitions, numPartitions, clientData, messageSize, now, allowMismatchedResults); } <<<<<<< int[] involvedPartitions = m_allPartitions; createTransaction(handler.connectionId(), handler.m_hostname, handler.isAdmin(), task, sysProc.getReadonly(), sysProc.getSinglepartition(), sysProc.getEverysite(), involvedPartitions, involvedPartitions.length, ccxn, buf.capacity(), System.currentTimeMillis()); return null; } ClientResponseImpl dispatchTopology(Config sysProc, ByteBuffer buf, StoredProcedureInvocation task, ClientInputHandler handler, Connection ccxn) { try { ColumnInfo[] masterCols = new ColumnInfo[] { new ColumnInfo("Partition", VoltType.STRING), new ColumnInfo("Sites", VoltType.STRING), new ColumnInfo("Leader", VoltType.STRING)}; VoltTable masterTable = new VoltTable(masterCols); Map<String, JSONObject> masters = m_iv2Masters.pointInTimeCache(); for (Entry<String, JSONObject> entry : masters.entrySet()) { long partitionId = Long.valueOf(entry.getValue().getLong("hsid")); masterTable.addRow(entry.getKey(), CoreUtils.hsIdCollectionToString(m_cartographer.getReplicasForIv2Master(entry.getKey())), CoreUtils.hsIdToString(partitionId)); } return new ClientResponseImpl(ClientResponseImpl.SUCCESS, new VoltTable[]{masterTable}, null, task.clientHandle); } catch(Exception e) { hostLog.error("Failed to create topology summary for @Statistics TOPO", e); return errorResponse(ccxn, task.clientHandle, ClientResponse.UNEXPECTED_FAILURE, null, e, true); ======= else { int[] involvedPartitions = m_allPartitions; createTransaction(handler.connectionId(), handler.m_hostname, handler.isAdmin(), task, sysProc.getReadonly(), sysProc.getSinglepartition(), sysProc.getEverysite(), involvedPartitions, involvedPartitions.length, ccxn, buf.capacity(), System.currentTimeMillis(), false); return null; >>>>>>> int[] involvedPartitions = m_allPartitions; createTransaction(handler.connectionId(), handler.m_hostname, handler.isAdmin(), task, sysProc.getReadonly(), sysProc.getSinglepartition(), sysProc.getEverysite(), involvedPartitions, involvedPartitions.length, ccxn, buf.capacity(), System.currentTimeMillis(), false); return null; } ClientResponseImpl dispatchTopology(Config sysProc, ByteBuffer buf, StoredProcedureInvocation task, ClientInputHandler handler, Connection ccxn) { try { ColumnInfo[] masterCols = new ColumnInfo[] { new ColumnInfo("Partition", VoltType.STRING), new ColumnInfo("Sites", VoltType.STRING), new ColumnInfo("Leader", VoltType.STRING)}; VoltTable masterTable = new VoltTable(masterCols); Map<String, JSONObject> masters = m_iv2Masters.pointInTimeCache(); for (Entry<String, JSONObject> entry : masters.entrySet()) { long partitionId = Long.valueOf(entry.getValue().getLong("hsid")); masterTable.addRow(entry.getKey(), CoreUtils.hsIdCollectionToString(m_cartographer.getReplicasForIv2Master(entry.getKey())), CoreUtils.hsIdToString(partitionId)); } return new ClientResponseImpl(ClientResponseImpl.SUCCESS, new VoltTable[]{masterTable}, null, task.clientHandle); } catch(Exception e) { hostLog.error("Failed to create topology summary for @Statistics TOPO", e); return errorResponse(ccxn, task.clientHandle, ClientResponse.UNEXPECTED_FAILURE, null, e, true);
<<<<<<< // this is a stupid hack to make the EE happy // rtb: Why does this melodious loop cheer the EE? for (int i = 0; i < m_expectedDeps.length; i++) { m_expectedDeps[i] = 1; } ======= >>>>>>> <<<<<<< for (int i = 0; i < m_paramTypesLength; i++) { try { paramList[i] = ParameterConverter.tryToMakeCompatible( m_paramTypeIsPrimitive[i], m_paramTypeIsArray[i], m_paramTypes[i], m_paramTypeComponentType[i], paramList[i]); } catch (Exception e) { ======= if (paramList.length != m_paramTypes.length) { >>>>>>> if (paramList.length != m_paramTypes.length) { <<<<<<< if (paramList.length != m_paramTypesLength) { m_statsCollector.endProcedure( false, true); String msg = "PROCEDURE " + m_procedureName + " EXPECTS " + String.valueOf(m_paramTypesLength) + " PARAMS, BUT RECEIVED " + String.valueOf(paramList.length); status = ClientResponseImpl.GRACEFUL_FAILURE; return getErrorResponse(status, msg, null); } for (int i = 0; i < m_paramTypesLength; i++) { try { paramList[i] = ParameterConverter.tryToMakeCompatible( m_paramTypeIsPrimitive[i], m_paramTypeIsArray[i], m_paramTypes[i], m_paramTypeComponentType[i], paramList[i]); } catch (Exception e) { m_statsCollector.endProcedure( false, true); String msg = "PROCEDURE " + m_procedureName + " TYPE ERROR FOR PARAMETER " + i + ": " + e.getMessage(); status = ClientResponseImpl.GRACEFUL_FAILURE; return getErrorResponse(status, msg, null); } } ClientResponseImpl retval = null; boolean error = false; boolean abort = false; // run a regular java class if (m_catProc.getHasjava()) { try { if (log.isTraceEnabled()) { log.trace("invoking... procMethod=" + m_procMethod.getName() + ", class=" + getClass().getName()); } ======= for (int i = 0; i < m_paramTypes.length; i++) { >>>>>>> for (int i = 0; i < m_paramTypes.length; i++) { <<<<<<< m_paramTypeIsPrimitive[param.getIndex()] = m_paramTypes[param.getIndex()].isPrimitive(); m_paramTypeIsArray[param.getIndex()] = param.getIsarray(); assert(m_paramTypeIsArray[param.getIndex()] == false); m_paramTypeComponentType[param.getIndex()] = null; // rtb: what is broken (ambiguous?) that is being patched here? // hack to fixup varbinary support for statement procedures if (m_paramTypes[param.getIndex()] == byte[].class) { m_paramTypeComponentType[param.getIndex()] = byte.class; m_paramTypeIsArray[param.getIndex()] = true; } ======= >>>>>>> m_paramTypeIsPrimitive[param.getIndex()] = m_paramTypes[param.getIndex()].isPrimitive(); m_paramTypeIsArray[param.getIndex()] = param.getIsarray(); assert(m_paramTypeIsArray[param.getIndex()] == false); m_paramTypeComponentType[param.getIndex()] = null; // rtb: what is broken (ambiguous?) that is being patched here? // hack to fixup varbinary support for statement procedures if (m_paramTypes[param.getIndex()] == byte[].class) { m_paramTypeComponentType[param.getIndex()] = byte.class; m_paramTypeIsArray[param.getIndex()] = true; }
<<<<<<< ======= import java.security.NoSuchAlgorithmException; import java.security.SecureRandom; import java.util.Arrays; >>>>>>> import java.security.NoSuchAlgorithmException; import java.security.SecureRandom; import java.util.Arrays; <<<<<<< Random r = new Random(0); Map<Long, Integer> newConfig = new HashMap<Long, Integer>(oldElasticHashinator.m_tokens); Set<Integer> existingPartitions = new HashSet<Integer>(oldElasticHashinator.m_tokens.values()); Set<Long> checkSet = new HashSet<Long>(oldElasticHashinator.m_tokens.keySet()); ======= SecureRandom sr; try { sr = SecureRandom.getInstance(SECURE_RANDOM_ALGORITHM); sr.setSeed(SECURE_RANDON_SEED); } catch (NoSuchAlgorithmException ex) { throw new RuntimeException("Unable to initialize secure random generator", ex); } Map<Long, Integer> newConfig = new HashMap<Long, Integer>(oldElasticHashinator.tokens); Set<Integer> existingPartitions = new HashSet<Integer>(oldElasticHashinator.tokens.values()); Set<Long> checkSet = new HashSet<Long>(oldElasticHashinator.tokens.keySet()); >>>>>>> SecureRandom sr; try { sr = SecureRandom.getInstance(SECURE_RANDOM_ALGORITHM); sr.setSeed(SECURE_RANDON_SEED); } catch (NoSuchAlgorithmException ex) { throw new RuntimeException("Unable to initialize secure random generator", ex); } Map<Long, Integer> newConfig = new HashMap<Long, Integer>(oldElasticHashinator.m_tokens); Set<Integer> existingPartitions = new HashSet<Integer>(oldElasticHashinator.m_tokens.values()); Set<Long> checkSet = new HashSet<Long>(oldElasticHashinator.m_tokens.keySet()); <<<<<<< return new ElasticHashinator(newConfig).toBytes(); } /** * Given an existing elastic hashinator, add a set of new partitions to the existing hash ring * with calculated ranges. * @param oldHashinator An elastic hashinator * @param partitionsAndRanges A set of new partitions and their associated ranges * @return The config bytes of the new hash ring */ public static byte[] addPartitions(TheHashinator oldHashinator, Map<Long, Integer> tokensToPartitions) { Preconditions.checkArgument(oldHashinator instanceof ElasticHashinator); ElasticHashinator oldElasticHashinator = (ElasticHashinator) oldHashinator; Map<Long, Integer> newConfig = new HashMap<Long, Integer>(oldElasticHashinator.m_tokens); //Set<Integer> existingPartitions = new HashSet<Integer>(oldElasticHashinator.tokens.values()); for (Map.Entry<Long, Integer> entry : tokensToPartitions.entrySet()) { long token = entry.getKey(); int pid = entry.getValue(); Integer oldPartition = newConfig.put(token, pid); if (oldPartition != null && oldPartition != pid) { throw new RuntimeException("Token " + token + " used to map to partition " + oldPartition + " but now maps to " + pid); } } return new ElasticHashinator(newConfig).toBytes(); ======= return new ElasticHashinator(newConfig).m_configBytes; >>>>>>> return new ElasticHashinator(newConfig).toBytes(); } /** * Given an existing elastic hashinator, add a set of new partitions to the existing hash ring * with calculated ranges. * @param oldHashinator An elastic hashinator * @param partitionsAndRanges A set of new partitions and their associated ranges * @return The config bytes of the new hash ring */ public static byte[] addPartitions(TheHashinator oldHashinator, Map<Long, Integer> tokensToPartitions) { Preconditions.checkArgument(oldHashinator instanceof ElasticHashinator); ElasticHashinator oldElasticHashinator = (ElasticHashinator) oldHashinator; Map<Long, Integer> newConfig = new HashMap<Long, Integer>(oldElasticHashinator.m_tokens); //Set<Integer> existingPartitions = new HashSet<Integer>(oldElasticHashinator.m_tokens.values()); for (Map.Entry<Long, Integer> entry : tokensToPartitions.entrySet()) { long token = entry.getKey(); int pid = entry.getValue(); Integer oldPartition = newConfig.put(token, pid); if (oldPartition != null && oldPartition != pid) { throw new RuntimeException("Token " + token + " used to map to partition " + oldPartition + " but now maps to " + pid); } } return new ElasticHashinator(newConfig).toBytes(); <<<<<<< private byte[] toBytes() { ByteBuffer buf = ByteBuffer.allocate(4 + (m_tokens.size() * 12));//long and an int per buf.putInt(m_tokens.size()); ======= public byte[] toBytes() { ByteBuffer buf = ByteBuffer.allocate(4 + (tokens.size() * 12));//long and an int per buf.putInt(tokens.size()); >>>>>>> private byte[] toBytes() { ByteBuffer buf = ByteBuffer.allocate(4 + (m_tokens.size() * 12));//long and an int per buf.putInt(m_tokens.size());
<<<<<<< import org.voltdb.pmsg.DRAgent.ClusterInfo; import java.util.List; ======= import java.io.IOException; >>>>>>> import org.voltdb.pmsg.DRAgent; import java.io.IOException; import java.util.List; <<<<<<< public interface DRProducerResponseHandler { public void notifyOfResponse(boolean success, boolean shouldRetry, String failureCause); } /* * Ensure that all enabled DR Producer Hosts have agreed on the PBD file name ======= /** * Start the main thread and the state machine, wait until all nodes converge on the initial state. * @throws IOException */ public void startAndWaitForGlobalAgreement() throws IOException; /** * Truncate the DR log using the snapshot restore truncation point cached * earlier. This is called on recover before the command log replay starts * to drop all binary logs generated after the snapshot. Command log replay * will recreate those binary logs. >>>>>>> public interface DRProducerResponseHandler { public void notifyOfResponse(boolean success, boolean shouldRetry, String failureCause); } /** * Start the main thread and the state machine, wait until all nodes converge on the initial state. * @throws IOException */ public void startAndWaitForGlobalAgreement() throws IOException; /** * Truncate the DR log using the snapshot restore truncation point cached * earlier. This is called on recover before the command log replay starts * to drop all binary logs generated after the snapshot. Command log replay * will recreate those binary logs. <<<<<<< /** * Blocks until snaphot is generated for the specified cluster id. * If the snapshot has already been generated, this will return immediately * * @param forClusterId the cluster for which producer should generate snapshot. * This is used and has a meaningful value only in MULTICLUSTER_PROTOCOL_VERSION * or higher. */ public void blockOnSyncSnapshotGeneration(byte forClusterId); /** * Sets the DR protocol version with EE. This will also generate a <code>DR_STREAM_START</code> * event for all partitions, if <code>genStreamStart</code> flag is true. * * @param drVersion the DR protocol version that must be set with EE. * @param genStreamStart <code>DR_STREAM_START</code> event will be generated for all partitions * if this is true. * * @return Returns true if the operation was successful. False otherwise. */ public boolean setDRProtocolVersion(int drVersion, boolean genStreamStart); /** * Use this to set up cursors in DR binary logs for clusters. This will initiate the process. * When the process is complete, the passed in handler will be notified of the status. * * @param requestedCursors the clusters for which cursors must be started * @param handler callback to notify the status of the operation */ public void startCursor(final List<ClusterInfo> requestedCursors, final DRProducerResponseHandler handler); ======= public void blockOnSyncSnapshotGeneration(); /** * Get the DR producer node stats. This method may block because the task * runs on the producer thread and it waits for the asynchronous task to * finish. * @return The producer node stats or null if on error */ public DRProducerNodeStats getNodeDRStats(); >>>>>>> /** * Blocks until snaphot is generated for the specified cluster id. * If the snapshot has already been generated, this will return immediately * * @param forClusterId the cluster for which producer should generate snapshot. * This is used and has a meaningful value only in MULTICLUSTER_PROTOCOL_VERSION * or higher. */ public void blockOnSyncSnapshotGeneration(byte forClusterId); /** * Sets the DR protocol version with EE. This will also generate a <code>DR_STREAM_START</code> * event for all partitions, if <code>genStreamStart</code> flag is true. * * @param drVersion the DR protocol version that must be set with EE. * @param genStreamStart <code>DR_STREAM_START</code> event will be generated for all partitions * if this is true. * * @return Returns true if the operation was successful. False otherwise. */ public boolean setDRProtocolVersion(int drVersion, boolean genStreamStart); /** * Use this to set up cursors in DR binary logs for clusters. This will initiate the process. * When the process is complete, the passed in handler will be notified of the status. * * @param requestedCursors the clusters for which cursors must be started * @param handler callback to notify the status of the operation */ public void startCursor(final List<DRAgent.ClusterInfo> requestedCursors, final DRProducerResponseHandler handler); /** * Get the DR producer node stats. This method may block because the task * runs on the producer thread and it waits for the asynchronous task to * finish. * @return The producer node stats or null if on error */ public DRProducerNodeStats getNodeDRStats();
<<<<<<< if (m_isLeader && !msg.isReadOnly() && m_sendToHSIds.size() > 0) { ======= //Don't replicate reads, this really assumes that DML validation //is going to be integrated soonish if (!msg.isReadOnly() && m_sendToHSIds.size() > 0) { >>>>>>> //Don't replicate reads, this really assumes that DML validation //is going to be integrated soonish if (m_isLeader && !msg.isReadOnly() && m_sendToHSIds.size() > 0) {
<<<<<<< import java.nio.ByteBuffer; ======= import java.util.regex.Pattern; >>>>>>> import java.nio.ByteBuffer; import java.util.regex.Pattern;
<<<<<<< m_ee.loadTable(WAREHOUSE_TABLEID, m_warehousedata, 0, 0, 0, 0, 0, false, false, Long.MAX_VALUE); ======= m_ee.loadTable(WAREHOUSE_TABLEID, m_warehousedata, 0, 0, 0, false, false, WRITE_TOKEN); >>>>>>> m_ee.loadTable(WAREHOUSE_TABLEID, m_warehousedata, 0, 0, 0, 0, 0, false, false, WRITE_TOKEN); <<<<<<< 3, 3, 2, 42, 42, Long.MAX_VALUE); ======= new String[] { selectStmt.getSqltext() }, 3, 3, 2, 42, Long.MAX_VALUE); >>>>>>> new String[] { selectStmt.getSqltext() }, 3, 3, 2, 42, 42, Long.MAX_VALUE); <<<<<<< 3, 3, 2, 42, 42, Long.MAX_VALUE); ======= new String[] { selectStmt.getSqltext() }, 3, 3, 2, 42, Long.MAX_VALUE); >>>>>>> new String[] { selectStmt.getSqltext() }, 3, 3, 2, 42, 42, Long.MAX_VALUE); <<<<<<< 3, 3, 2, 42, 42, Long.MAX_VALUE); ======= new String[] { deleteStmt.getSqltext() }, 3, 3, 2, 42, WRITE_TOKEN); >>>>>>> new String[] { deleteStmt.getSqltext() }, 3, 3, 2, 42, 42, WRITE_TOKEN); <<<<<<< 3, 3, 2, 42, 42, Long.MAX_VALUE); ======= new String[] { selectStmt.getSqltext() }, 3, 3, 2, 42, Long.MAX_VALUE); >>>>>>> new String[] { selectStmt.getSqltext() }, 3, 3, 2, 42, 42, Long.MAX_VALUE); <<<<<<< m_ee.loadTable(WAREHOUSE_TABLEID, m_warehousedata, 0, 0, 0, 0, 0, false, false, Long.MAX_VALUE); ======= m_ee.loadTable(WAREHOUSE_TABLEID, m_warehousedata, 0, 0, 0, false, false, WRITE_TOKEN); >>>>>>> m_ee.loadTable(WAREHOUSE_TABLEID, m_warehousedata, 0, 0, 0, 0, 0, false, false, WRITE_TOKEN); <<<<<<< 3, 3, 2, 42, 42, Long.MAX_VALUE); ======= new String[] { selectStmt.getSqltext() }, 3, 3, 2, 42, Long.MAX_VALUE); >>>>>>> new String[] { selectStmt.getSqltext() }, 3, 3, 2, 42, 42, Long.MAX_VALUE);
<<<<<<< public void onSuccessfulProcedureCall(long txnId, long uniqueId, ======= public void onSuccessfulProcedureCall(long txnId, long timestamp, int hash, >>>>>>> public void onSuccessfulProcedureCall(long txnId, long uniqueId, int hash, <<<<<<< public void onSuccessfulMPCall(long spHandle, long txnId, long uniqueId, ======= public void onSuccessfulMPCall(long spHandle, long txnId, long timestamp, int hash, >>>>>>> public void onSuccessfulMPCall(long spHandle, long txnId, long uniqueId, int hash,
<<<<<<< import org.voltdb.PartitionDRGateway; import org.voltdb.ProcedureRunner; import org.voltdb.SiteProcedureConnection; ======= >>>>>>> import org.voltdb.PartitionDRGateway;
<<<<<<< public <T> ListenableFuture<T> submitSnapshotIOWork(Callable<T> work) { assert m_snapshotIOAgent != null; return m_snapshotIOAgent.submit(work); } ======= @Override public long getClusterUptime() { return System.currentTimeMillis() - getHostMessenger().getInstanceId().getTimestamp(); } >>>>>>> public <T> ListenableFuture<T> submitSnapshotIOWork(Callable<T> work) { assert m_snapshotIOAgent != null; return m_snapshotIOAgent.submit(work); } @Override public long getClusterUptime() { return System.currentTimeMillis() - getHostMessenger().getInstanceId().getTimestamp(); }
<<<<<<< public CommandLine enableIV2(boolean enable) { m_enableIV2 = enable; return this; } ======= // user-customizable string appeneded to commandline. // useful to allow customization of VEM/REST cmdlns. // Please don't abuse this by shoving lots of long-term // things here that really deserve top-level fields. String customCmdLn; public CommandLine customCmdLn(String customCmdLn) { this.customCmdLn = customCmdLn; return this; } >>>>>>> public CommandLine enableIV2(boolean enable) { m_enableIV2 = enable; return this; } // user-customizable string appeneded to commandline. // useful to allow customization of VEM/REST cmdlns. // Please don't abuse this by shoving lots of long-term // things here that really deserve top-level fields. String customCmdLn; public CommandLine customCmdLn(String customCmdLn) { this.customCmdLn = customCmdLn; return this; } <<<<<<< if (m_enableIV2) { cmdline.add("enableiv2"); } ======= if (customCmdLn != null && !customCmdLn.isEmpty()) { cmdline.add(customCmdLn); } >>>>>>> if (m_enableIV2) { cmdline.add("enableiv2"); } if (customCmdLn != null && !customCmdLn.isEmpty()) { cmdline.add(customCmdLn); }
<<<<<<< * @param failedInitiators * @param failedSites ======= >>>>>>> * @param failedInitiators <<<<<<< public abstract Semaphore logFault(Set<Integer> failedInitiators, Set<Integer> failedSites, Set<Long> faultedTxns); ======= public abstract Semaphore logFault(Set<Long> faultedTxns); >>>>>>> public abstract Semaphore logFault(Set<Integer> failedInitiators, Set<Long> faultedTxns);
<<<<<<< ======= import org.voltcore.messaging.HostMessenger; import org.voltcore.messaging.LocalObjectMessage; import org.voltcore.messaging.Mailbox; import org.voltcore.network.Connection; import org.voltcore.network.VoltNetworkPool; >>>>>>>
<<<<<<< final Map<String, String> m_drTables = new LinkedHashMap<String, String>(); ======= final Set<String> m_importLines = new TreeSet<String>(); >>>>>>> final Map<String, String> m_drTables = new LinkedHashMap<String, String>(); final Set<String> m_importLines = new TreeSet<String>();
<<<<<<< public ParameterSet getParameterSetForFragment(int index) { ParameterSet params = null; final ByteBuffer paramData = m_items.get(index).m_parameterSet.asReadOnlyBuffer(); if (paramData != null) { final FastDeserializer fds = new FastDeserializer(paramData); try { params = fds.readObject(ParameterSet.class); } catch (final IOException e) { hostLog.l7dlog(Level.FATAL, LogKeys.host_ExecutionSite_FailedDeserializingParamsForFragmentTask.name(), e); VoltDB.crashLocalVoltDB(e.getMessage(), true, e); } } else { params = new ParameterSet(); } return params; } public String getFragmentPlan(int index) { ======= public byte[] getFragmentPlan(int index) { >>>>>>> public ParameterSet getParameterSetForFragment(int index) { ParameterSet params = null; final ByteBuffer paramData = m_items.get(index).m_parameterSet.asReadOnlyBuffer(); if (paramData != null) { final FastDeserializer fds = new FastDeserializer(paramData); try { params = fds.readObject(ParameterSet.class); } catch (final IOException e) { hostLog.l7dlog(Level.FATAL, LogKeys.host_ExecutionSite_FailedDeserializingParamsForFragmentTask.name(), e); VoltDB.crashLocalVoltDB(e.getMessage(), true, e); } } else { params = new ParameterSet(); } return params; } public byte[] getFragmentPlan(int index) {
<<<<<<< ======= private int currentTorrentIndex = -1; >>>>>>> private int currentTorrentIndex = -1; <<<<<<< SharedPreferences mSharedPrefs = PreferenceManager.getDefaultSharedPreferences(this); G.DEBUG = mSharedPrefs.getBoolean(G.PREF_DEBUG, false); ======= SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this); G.DEBUG = prefs.getBoolean(G.PREF_DEBUG, false); >>>>>>> SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this); G.DEBUG = prefs.getBoolean(G.PREF_DEBUG, false);
<<<<<<< ======= @SuppressWarnings("unchecked") >>>>>>> @SuppressWarnings("unchecked")
<<<<<<< import java.util.ArrayList; import java.util.List; ======= import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; >>>>>>> import java.util.ArrayList; import java.util.List; import java.util.HashMap; import java.util.Map; <<<<<<< import org.apache.storm.hdfs.bolt.HdfsBolt; import org.apache.storm.hdfs.bolt.format.*; import org.apache.storm.hdfs.bolt.rotation.FileRotationPolicy; import org.apache.storm.hdfs.bolt.rotation.FileSizeRotationPolicy; import org.apache.storm.hdfs.bolt.rotation.FileSizeRotationPolicy.Units; import org.apache.storm.hdfs.bolt.sync.CountSyncPolicy; import org.apache.storm.hdfs.bolt.sync.SyncPolicy; ======= import org.apache.storm.hdfs.bolt.HdfsBolt; import org.apache.storm.hdfs.bolt.format.DefaultFileNameFormat; import org.apache.storm.hdfs.bolt.format.DelimitedRecordFormat; import org.apache.storm.hdfs.bolt.format.FileNameFormat; import org.apache.storm.hdfs.bolt.format.RecordFormat; import org.apache.storm.hdfs.bolt.rotation.FileRotationPolicy; import org.apache.storm.hdfs.bolt.rotation.FileSizeRotationPolicy; import org.apache.storm.hdfs.bolt.rotation.FileSizeRotationPolicy.Units; import org.apache.storm.hdfs.bolt.sync.CountSyncPolicy; import org.apache.storm.hdfs.bolt.sync.SyncPolicy; >>>>>>> import org.apache.storm.hdfs.bolt.HdfsBolt; import org.apache.storm.hdfs.bolt.format.DefaultFileNameFormat; import org.apache.storm.hdfs.bolt.format.DelimitedRecordFormat; import org.apache.storm.hdfs.bolt.format.FileNameFormat; import org.apache.storm.hdfs.bolt.format.RecordFormat; import org.apache.storm.hdfs.bolt.rotation.FileRotationPolicy; import org.apache.storm.hdfs.bolt.rotation.FileSizeRotationPolicy; import org.apache.storm.hdfs.bolt.rotation.FileSizeRotationPolicy.Units; import org.apache.storm.hdfs.bolt.sync.CountSyncPolicy; import org.apache.storm.hdfs.bolt.sync.SyncPolicy; <<<<<<< ======= import storm.kafka.BrokerHosts; import storm.kafka.KafkaSpout; import storm.kafka.SpoutConfig; import storm.kafka.StringScheme; import storm.kafka.ZkHosts; import storm.kafka.bolt.KafkaBolt; >>>>>>> import storm.kafka.BrokerHosts; import storm.kafka.KafkaSpout; import storm.kafka.SpoutConfig; import storm.kafka.StringScheme; import storm.kafka.ZkHosts; import storm.kafka.bolt.KafkaBolt; <<<<<<< import com.opensoc.enrichment.adapters.cif.CIFHbaseAdapter; import com.opensoc.enrichment.adapters.whois.WhoisHBaseAdapter; import com.opensoc.enrichment.common.EnrichmentAdapter; import com.opensoc.enrichment.common.GenericEnrichmentBolt; import com.opensoc.indexing.TelemetryIndexingBolt; import com.opensoc.indexing.adapters.ESBaseBulkAdapter; ======= import com.opensoc.enrichment.adapters.cif.CIFHbaseAdapter; import com.opensoc.enrichment.adapters.geo.GeoMysqlAdapter; import com.opensoc.enrichment.adapters.whois.WhoisHBaseAdapter; import com.opensoc.enrichment.common.EnrichmentAdapter; import com.opensoc.enrichment.common.GenericEnrichmentBolt; import com.opensoc.enrichment.host.HostAdapter; import com.opensoc.indexing.TelemetryIndexingBolt; import com.opensoc.indexing.adapters.ESBaseBulkAdapter; >>>>>>> import com.opensoc.enrichment.adapters.cif.CIFHbaseAdapter; import com.opensoc.enrichment.adapters.whois.WhoisHBaseAdapter; import com.opensoc.enrichment.common.EnrichmentAdapter; import com.opensoc.enrichment.common.GenericEnrichmentBolt; import com.opensoc.enrichment.adapters.geo.GeoMysqlAdapter; import com.opensoc.enrichment.host.HostAdapter; import com.opensoc.indexing.TelemetryIndexingBolt; import com.opensoc.indexing.adapters.ESBaseBulkAdapter;
<<<<<<< import java.util.ArrayList; import java.util.List; ======= import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; >>>>>>> import java.util.ArrayList; import java.util.List; import java.util.HashMap; import java.util.Map; <<<<<<< import org.apache.storm.hdfs.bolt.HdfsBolt; import org.apache.storm.hdfs.bolt.format.*; import org.apache.storm.hdfs.bolt.rotation.FileRotationPolicy; import org.apache.storm.hdfs.bolt.rotation.FileSizeRotationPolicy; import org.apache.storm.hdfs.bolt.rotation.FileSizeRotationPolicy.Units; import org.apache.storm.hdfs.bolt.sync.CountSyncPolicy; import org.apache.storm.hdfs.bolt.sync.SyncPolicy; ======= import org.apache.storm.hdfs.bolt.HdfsBolt; import org.apache.storm.hdfs.bolt.format.DefaultFileNameFormat; import org.apache.storm.hdfs.bolt.format.DelimitedRecordFormat; import org.apache.storm.hdfs.bolt.format.FileNameFormat; import org.apache.storm.hdfs.bolt.format.RecordFormat; import org.apache.storm.hdfs.bolt.rotation.FileRotationPolicy; import org.apache.storm.hdfs.bolt.rotation.FileSizeRotationPolicy; import org.apache.storm.hdfs.bolt.rotation.FileSizeRotationPolicy.Units; import org.apache.storm.hdfs.bolt.sync.CountSyncPolicy; import org.apache.storm.hdfs.bolt.sync.SyncPolicy; >>>>>>> import org.apache.storm.hdfs.bolt.HdfsBolt; import org.apache.storm.hdfs.bolt.format.DefaultFileNameFormat; import org.apache.storm.hdfs.bolt.format.DelimitedRecordFormat; import org.apache.storm.hdfs.bolt.format.FileNameFormat; import org.apache.storm.hdfs.bolt.format.RecordFormat; import org.apache.storm.hdfs.bolt.rotation.FileRotationPolicy; import org.apache.storm.hdfs.bolt.rotation.FileSizeRotationPolicy; import org.apache.storm.hdfs.bolt.rotation.FileSizeRotationPolicy.Units; import org.apache.storm.hdfs.bolt.sync.CountSyncPolicy; import org.apache.storm.hdfs.bolt.sync.SyncPolicy; <<<<<<< ======= import storm.kafka.BrokerHosts; import storm.kafka.KafkaSpout; import storm.kafka.SpoutConfig; import storm.kafka.StringScheme; import storm.kafka.ZkHosts; import storm.kafka.bolt.KafkaBolt; >>>>>>> import storm.kafka.BrokerHosts; import storm.kafka.KafkaSpout; import storm.kafka.SpoutConfig; import storm.kafka.StringScheme; import storm.kafka.ZkHosts; import storm.kafka.bolt.KafkaBolt; <<<<<<< import com.opensoc.enrichment.adapters.cif.CIFHbaseAdapter; import com.opensoc.enrichment.adapters.whois.WhoisHBaseAdapter; import com.opensoc.enrichment.common.EnrichmentAdapter; import com.opensoc.enrichment.common.GenericEnrichmentBolt; import com.opensoc.indexing.TelemetryIndexingBolt; import com.opensoc.indexing.adapters.ESBaseBulkAdapter; ======= import com.opensoc.enrichment.adapters.cif.CIFHbaseAdapter; import com.opensoc.enrichment.adapters.geo.GeoMysqlAdapter; import com.opensoc.enrichment.adapters.whois.WhoisHBaseAdapter; import com.opensoc.enrichment.common.EnrichmentAdapter; import com.opensoc.enrichment.common.GenericEnrichmentBolt; import com.opensoc.enrichment.host.HostAdapter; import com.opensoc.indexing.TelemetryIndexingBolt; import com.opensoc.indexing.adapters.ESBaseBulkAdapter; >>>>>>> import com.opensoc.enrichment.adapters.cif.CIFHbaseAdapter; import com.opensoc.enrichment.adapters.whois.WhoisHBaseAdapter; import com.opensoc.enrichment.common.EnrichmentAdapter; import com.opensoc.enrichment.common.GenericEnrichmentBolt; import com.opensoc.enrichment.adapters.geo.GeoMysqlAdapter; import com.opensoc.enrichment.host.HostAdapter; import com.opensoc.indexing.TelemetryIndexingBolt; import com.opensoc.indexing.adapters.ESBaseBulkAdapter;
<<<<<<< return "function (" + n.getChild(0).getText() + ") " + IBLOCK((PassNode) n.getChild(1)); return "function (" + n.getChild(0).getText() + ")" + n.getChild(1).getText(); ======= return FUNCTION + n.getChild(0).getText() + ") { " + n.getChild(1).getText() +" }"; return FUNCTION + n.getChild(0).getText() + ")" + n.getChild(1).getText(); >>>>>>> return "function (" + n.getChild(0).getText() + ") { " + n.getChild(1).getText() +" }"; return "function (" + n.getChild(0).getText() + ")" + n.getChild(1).getText(); <<<<<<< String iterator = n.getChild(0).getText(); String collection = n.getChild(1).getText(); String body = n.getChild(2).getText(); return "for (" + iterator + " in " + collection + ')' + translateIterator(iterator,collection,body) + "\n"; ======= //for(var i in ARRAY) IBLOCK return FOR + genericCombine(n, " in ", ")") + "\n"; >>>>>>> String iterator = n.getChild(0).getText(); String collection = n.getChild(1).getText(); String body = n.getChild(2).getText(); return "for (" + iterator + " in " + collection + ')' + translateIterator(iterator,collection,body) + "\n"; <<<<<<< ======= >>>>>>>
<<<<<<< private static final String jsRequire = "var pass = require('pass');\nfor (var x in pass)\n global[x] = pass[x];\n\n"; ======= //the dir needs to be modified later private static final String jsIncludeString = "var stdlib = require('../lib/stdlib.js');\n\n"; private static HashMap<String, String> stdLibMembers = new HashMap<String, String>(); public CodeGenerator() { stdLibMembers.put(LOG, ""); stdLibMembers.put(TAG, ""); stdLibMembers.put(TAGS, ""); stdLibMembers.put(CONTAINS, ""); stdLibMembers.put(CONNS, ""); stdLibMembers.put(UNTAG, ""); } private void removeVar(PassNode n) { if (n == null) return; String var = n.getText(); Matcher m = variablePattern.matcher(var); if (m.matches()) { if (n.isVarDefined(var)) { errors = true; System.out.println("ERROR: line " + n.getLine() + " :: variable " + var + " is used before it is defined"); } } } public boolean hasErrors() { return errors; } >>>>>>> private static final String jsRequire = "var pass = require('pass');\nfor (var x in pass)\n global[x] = pass[x];\n\n"; private static HashMap<String, String> stdLibMembers = new HashMap<String, String>(); public CodeGenerator() { stdLibMembers.put(LOG, ""); stdLibMembers.put(TAG, ""); stdLibMembers.put(TAGS, ""); stdLibMembers.put(CONTAINS, ""); stdLibMembers.put(CONNS, ""); stdLibMembers.put(UNTAG, ""); } private void removeVar(PassNode n) { if (n == null) return; String var = n.getText(); Matcher m = variablePattern.matcher(var); if (m.matches()) { if (n.isVarDefined(var)) { errors = true; System.out.println("ERROR: line " + n.getLine() + " :: variable " + var + " is used before it is defined"); } } } public boolean hasErrors() { return errors; } <<<<<<< return (stdLibFunctionsCalled ? jsRequire : EMPTY_STRING) + res.trim(); ======= return (stdLibFunctionsCalled ? jsIncludeString : "") + res.trim(); >>>>>>> return (stdLibFunctionsCalled ? jsRequire : "") + res.trim(); <<<<<<< ======= >>>>>>>
<<<<<<< ======= import java.beans.EventHandler; import com.jfoenix.controls.JFXButton; import com.jfoenix.controls.JFXTextField; >>>>>>> import java.beans.EventHandler; import com.jfoenix.controls.JFXButton; import com.jfoenix.controls.JFXTextField; <<<<<<< private TreeItem parentFolder = new TreeItem<>("All Bookmarks", new ImageView(folderImage)); private ObservableList<String> folders = BookMarksDataBase.folders(); public BookMarks() { table.setEditable(false); for (int i = 0; i < folders.size(); i++) { ======= TreeItem parentFolder = new TreeItem<>("All Bookmarks"); private ObservableList<String> folders = BookMarksDataBase.folders(1); public BookMarks(){ for(int i=0 ; i< folders.size();i++){ >>>>>>> TreeItem parentFolder = new TreeItem<>("All Bookmarks"); private ObservableList<String> folders = BookMarksDataBase.folders(1); public BookMarks(){ for(int i=0 ; i< folders.size();i++){
<<<<<<< ======= import javafx.geometry.Pos; import com.jfoenix.controls.JFXDialog; import com.jfoenix.controls.JFXDialogLayout; import javax.management.NotificationFilter; import org.controlsfx.control.NotificationPane; import org.controlsfx.control.Notifications; import org.controlsfx.control.action.Action; import javafx.application.Platform; import javafx.collections.FXCollections; import javafx.event.ActionEvent; import javafx.scene.Scene; >>>>>>> import javafx.geometry.Pos; import com.jfoenix.controls.JFXDialog; import com.jfoenix.controls.JFXDialogLayout; import javax.management.NotificationFilter; import org.controlsfx.control.NotificationPane; import org.controlsfx.control.action.Action; import javafx.application.Platform; import javafx.event.ActionEvent; import javafx.scene.Scene; <<<<<<< ======= import javafx.scene.image.Image; import javafx.scene.image.ImageView; >>>>>>> <<<<<<< private String folder; private String title; private ObservableList<String> options; ======= private String folder = null; String title; ObservableList<String> options; >>>>>>> private String folder; private String title; private ObservableList<String> options; // Classes objects to get methods or set methods access <<<<<<< } ======= detectForm.insert(doc); // String imgs = ""; // File f = new File(getClass().getResource("/screenshots").getFile()); // for (File fs : f.listFiles()) { // imgs += "<img src=\""+fs.toURI()+"\" width='100' height = '100' />"; // } // System.out.println("images:"+imgs); // System.out.println("Hello \"" + imgs + "\""); //// webEngine.loadContent("<div>"+imgs+"</div>"); // String div = "var body = document.getElementsByTagName('body')[0];" // + "var newElement = document.createElement('div');" // + "var center = document.createElement('center');" // + "newElement.append = " // + "newElement.setAttribute('id', 'custom_div');" // + "center.appendChild(newElement);" // +"body.appendChild(center);"; //// webEngine.executeScript("document.getElementsByTagName('body')[0].innerHTML =\"" + imgs + "\""); // webEngine.executeScript("if (!window.indexedDB) window.alert(\"Your browser doesn't support a stable version of IndexedDB.\")"); } >>>>>>> detectForm.insert(doc); } <<<<<<< options = BookMarksDataBase.folders(); ======= options = BookMarksDataBase.folders(1); >>>>>>> options = BookMarksDataBase.folders(1); <<<<<<< saveMark.addEventHandler(MouseEvent.MOUSE_CLICKED, (s) -> { System.out.println(folder); if (folder == null) { folder = markFolderList.getItems().get(0); ======= saveMark.addEventHandler(MouseEvent.MOUSE_CLICKED, (s)->{ if(folder==null){ folder=markFolderList.getItems().get(0); >>>>>>> saveMark.addEventHandler(MouseEvent.MOUSE_CLICKED, (s)->{ if(folder==null){ folder=markFolderList.getItems().get(0); <<<<<<< TextInputDialog dialog = new TextInputDialog("walter"); ======= TextInputDialog dialog = new TextInputDialog("All Bookmarks"); >>>>>>> TextInputDialog dialog = new TextInputDialog("All Bookmarks"); <<<<<<< result.ifPresent(name -> { if (!name.equals("")) { this.folder = name; options.add(folder); } if (title == null) { ======= result.ifPresent(name ->{ if(title==null){ System.out.println("null title"); >>>>>>> result.ifPresent(name ->{ if(title==null){ System.out.println("null title"); <<<<<<< BookMarksDataBase.insertBookmarks(searchField.getText(), folder, title, 1); }); ======= if(name!=null && !name.isEmpty()){ this.folder = name; options.add(folder); BookMarksDataBase.insertBookmarks(searchField.getText(), folder,title,1); }else{ Notifications notify = Notifications.create().title("BookMark Folder") .text("No Folder specified.") .hideAfter(javafx.util.Duration.seconds(1)) .position(Pos.BOTTOM_RIGHT); notify.darkStyle(); notify.showInformation(); } }); >>>>>>> if(name!=null && !name.isEmpty()){ this.folder = name; options.add(folder); BookMarksDataBase.insertBookmarks(searchField.getText(), folder,title,1); }else{ Notifications notify = Notifications.create().title("BookMark Folder") .text("No Folder specified.") .hideAfter(javafx.util.Duration.seconds(1)) .position(Pos.BOTTOM_RIGHT); notify.darkStyle(); notify.showInformation(); } }); <<<<<<< ======= >>>>>>>
<<<<<<< import java.util.ArrayList; ======= import java.util.ResourceBundle; import com.jfoenix.controls.JFXButton; import com.jfoenix.controls.JFXDrawer; import com.jfoenix.controls.JFXDrawersStack; import com.jfoenix.controls.JFXTreeTableColumn; import com.jfoenix.controls.JFXTreeTableView; import com.jfoenix.controls.RecursiveTreeItem; import com.jfoenix.controls.datamodels.treetable.RecursiveTreeObject; >>>>>>> import java.util.ArrayList; <<<<<<< import javafx.scene.control.TreeCell; ======= >>>>>>> import javafx.scene.control.TreeCell; <<<<<<< import javafx.scene.control.TreeView; import javafx.scene.input.MouseEvent; ======= import javafx.scene.control.TreeTableColumn.CellDataFeatures; >>>>>>> import javafx.scene.control.TreeView; import javafx.scene.input.MouseEvent; <<<<<<< EventHandler<MouseEvent> mouseEventHandle = (MouseEvent event) -> { handleMouseClicked(event); }; ======= @SuppressWarnings("unchecked") >>>>>>> EventHandler<MouseEvent> mouseEventHandle = (MouseEvent event) -> { handleMouseClicked(event); };
<<<<<<< /** * Copyright 2011-2012 Intellectual Reserve, Inc. All Rights reserved. */ package org.gedcomx.types; import org.testng.annotations.Test; import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertFalse; import static org.testng.Assert.assertTrue; /** */ public class TypesTest { @Test public void testToQNameURI() throws Exception { // NOTE: not a full test, but gets some code coverage assertEquals(AgePartType.fromQNameURI(AgePartType.Days.toQNameURI()).toQNameURI().toString(), "http://gedcomx.org/Days"); assertEquals(ConfidenceLevel.fromQNameURI(ConfidenceLevel.Possibly.toQNameURI()).toQNameURI().toString(), "http://gedcomx.org/Possibly"); assertEquals(DateFormatType.fromQNameURI(DateFormatType.ISO8601.toQNameURI()).toQNameURI().toString(), "iso:8601"); assertEquals(DatePartType.fromQNameURI(DatePartType.Days.toQNameURI()).toQNameURI().toString(), "http://gedcomx.org/Days"); assertEquals(EventRoleType.fromQNameURI(EventRoleType.Principal.toQNameURI()).toQNameURI().toString(), "http://gedcomx.org/Principal"); assertEquals(EventType.fromQNameURI(EventType.Burial.toQNameURI()).toQNameURI().toString(), "http://gedcomx.org/Burial"); assertEquals(FactType.fromQNameURI(FactType.Marriage.toQNameURI()).toQNameURI().toString(), "http://gedcomx.org/Marriage"); assertEquals(FactType.fromQNameURI(FactType.Birth.toQNameURI()).toQNameURI().toString(), "http://gedcomx.org/Birth"); assertEquals(FactType.fromQNameURI(FactType.Baptism.toQNameURI()).toQNameURI().toString(), "http://gedcomx.org/Baptism"); assertEquals(GenderType.fromQNameURI(GenderType.Male.toQNameURI()).toQNameURI().toString(), "http://gedcomx.org/Male"); assertEquals(IdentifierType.fromQNameURI(IdentifierType.Primary.toQNameURI()).toQNameURI().toString(), "http://gedcomx.org/Primary"); assertEquals(MaritalStatusType.fromQNameURI(MaritalStatusType.Married.toQNameURI()).toQNameURI().toString(), "http://gedcomx.org/Married"); assertEquals(NamePartQualifierType.fromQNameURI(NamePartQualifierType.Maiden.toQNameURI()).toQNameURI().toString(), "http://gedcomx.org/Maiden"); assertEquals(NamePartType.fromQNameURI(NamePartType.Given.toQNameURI()).toQNameURI().toString(), "http://gedcomx.org/Given"); assertEquals(NameType.fromQNameURI(NameType.FormalName.toQNameURI()).toQNameURI().toString(), "http://gedcomx.org/FormalName"); assertEquals(PlacePartType.fromQNameURI(PlacePartType.Address.toQNameURI()).toQNameURI().toString(), "http://gedcomx.org/Address"); assertEquals(RecordType.fromQNameURI(RecordType.Census.toQNameURI()).toQNameURI().toString(), "http://gedcomx.org/Census"); assertEquals(RelationshipType.fromQNameURI(RelationshipType.Couple.toQNameURI()).toQNameURI().toString(), "http://gedcomx.org/Couple"); } @Test public void testFactTypeIsLike() throws Exception { // NOTE: not a full test, but gets some code coverage assertTrue(FactType.Christening.isBirthLike()); assertTrue(FactType.Burial.isDeathLike()); assertTrue(FactType.MarriageBanns.isMarriageLike()); assertTrue(FactType.DivorceFiling.isDivorceLike()); assertTrue(FactType.Naturalization.isMigrationLike()); } @Test public void testFactTypeInnerClasses() throws Exception { // NOTE: not a full test, but gets some code coverage assertTrue(FactType.Person.isApplicable(FactType.Will)); assertTrue(FactType.Couple.isApplicable(FactType.Separation)); assertTrue(FactType.ParentChild.isApplicable(FactType.Guardianship)); } @Test public void testRecordTypeHelpers() throws Exception { // NOTE: not a full test, but gets some code coverage assertTrue(RecordType.Vital.isVital()); assertTrue(RecordType.Birth.isVital()); assertFalse(RecordType.Census.isVital()); assertEquals(RecordType.Marriage.getBaseType(), RecordType.Vital); assertEquals(RecordType.Bank.getBaseType(), RecordType.Legal); assertEquals(RecordType.Draft.getBaseType(), RecordType.Military); assertEquals(RecordType.Census.getBaseType(), RecordType.Census); } } ======= /** * Copyright 2011-2012 Intellectual Reserve, Inc. All Rights reserved. */ package org.gedcomx.types; import org.testng.annotations.Test; import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertTrue; /** */ public class TypesTest { @Test public void testToQNameURI() throws Exception { // NOTE: not a full test, but gets some code coverage assertEquals(ConfidenceLevel.fromQNameURI(ConfidenceLevel.Possibly.toQNameURI()).toQNameURI().toString(), "http://gedcomx.org/Possibly"); assertEquals(DocumentType.fromQNameURI(DocumentType.Analysis.toQNameURI()).toQNameURI().toString(), "http://gedcomx.org/Analysis"); assertEquals(EventRoleType.fromQNameURI(EventRoleType.Principal.toQNameURI()).toQNameURI().toString(), "http://gedcomx.org/Principal"); assertEquals(EventType.fromQNameURI(EventType.Burial.toQNameURI()).toQNameURI().toString(), "http://gedcomx.org/Burial"); assertEquals(FactType.fromQNameURI(FactType.Marriage.toQNameURI()).toQNameURI().toString(), "http://gedcomx.org/Marriage"); assertEquals(FactType.fromQNameURI(FactType.Birth.toQNameURI()).toQNameURI().toString(), "http://gedcomx.org/Birth"); assertEquals(FactType.fromQNameURI(FactType.Baptism.toQNameURI()).toQNameURI().toString(), "http://gedcomx.org/Baptism"); assertEquals(GenderType.fromQNameURI(GenderType.Male.toQNameURI()).toQNameURI().toString(), "http://gedcomx.org/Male"); assertEquals(IdentifierType.fromQNameURI(IdentifierType.Primary.toQNameURI()).toQNameURI().toString(), "http://gedcomx.org/Primary"); assertEquals(NamePartType.fromQNameURI(NamePartType.Given.toQNameURI()).toQNameURI().toString(), "http://gedcomx.org/Given"); assertEquals(NameType.fromQNameURI(NameType.Formal.toQNameURI()).toQNameURI().toString(), "http://gedcomx.org/Formal"); assertEquals(RelationshipType.fromQNameURI(RelationshipType.Couple.toQNameURI()).toQNameURI().toString(), "http://gedcomx.org/Couple"); } @Test public void testFactTypeIsLike() throws Exception { // NOTE: not a full test, but gets some code coverage assertTrue(FactType.Christening.isBirthLike()); assertTrue(FactType.Burial.isDeathLike()); assertTrue(FactType.MarriageBanns.isMarriageLike()); assertTrue(FactType.DivorceFiling.isDivorceLike()); assertTrue(FactType.Naturalization.isMigrationLike()); } @Test public void testFactTypeInnerClasses() throws Exception { // NOTE: not a full test, but gets some code coverage assertTrue(FactType.Person.isApplicable(FactType.Will)); assertTrue(FactType.Couple.isApplicable(FactType.Separation)); assertTrue(FactType.ParentChild.isApplicable(FactType.Guardianship)); } } >>>>>>> /** * Copyright 2011-2012 Intellectual Reserve, Inc. All Rights reserved. */ package org.gedcomx.types; import org.testng.annotations.Test; import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertTrue; /** */ public class TypesTest { @Test public void testToQNameURI() throws Exception { // NOTE: not a full test, but gets some code coverage assertEquals(ConfidenceLevel.fromQNameURI(ConfidenceLevel.Possibly.toQNameURI()).toQNameURI().toString(), "http://gedcomx.org/Possibly"); assertEquals(DocumentType.fromQNameURI(DocumentType.Analysis.toQNameURI()).toQNameURI().toString(), "http://gedcomx.org/Analysis"); assertEquals(EventRoleType.fromQNameURI(EventRoleType.Principal.toQNameURI()).toQNameURI().toString(), "http://gedcomx.org/Principal"); assertEquals(EventType.fromQNameURI(EventType.Burial.toQNameURI()).toQNameURI().toString(), "http://gedcomx.org/Burial"); assertEquals(FactType.fromQNameURI(FactType.Marriage.toQNameURI()).toQNameURI().toString(), "http://gedcomx.org/Marriage"); assertEquals(FactType.fromQNameURI(FactType.Birth.toQNameURI()).toQNameURI().toString(), "http://gedcomx.org/Birth"); assertEquals(FactType.fromQNameURI(FactType.Baptism.toQNameURI()).toQNameURI().toString(), "http://gedcomx.org/Baptism"); assertEquals(GenderType.fromQNameURI(GenderType.Male.toQNameURI()).toQNameURI().toString(), "http://gedcomx.org/Male"); assertEquals(IdentifierType.fromQNameURI(IdentifierType.Primary.toQNameURI()).toQNameURI().toString(), "http://gedcomx.org/Primary"); assertEquals(NamePartQualifierType.fromQNameURI(NamePartQualifierType.Maiden.toQNameURI()).toQNameURI().toString(), "http://gedcomx.org/Maiden"); assertEquals(NamePartType.fromQNameURI(NamePartType.Given.toQNameURI()).toQNameURI().toString(), "http://gedcomx.org/Given"); assertEquals(NameType.fromQNameURI(NameType.FormalName.toQNameURI()).toQNameURI().toString(), "http://gedcomx.org/FormalName"); assertEquals(RelationshipType.fromQNameURI(RelationshipType.Couple.toQNameURI()).toQNameURI().toString(), "http://gedcomx.org/Couple"); } @Test public void testFactTypeIsLike() throws Exception { // NOTE: not a full test, but gets some code coverage assertTrue(FactType.Christening.isBirthLike()); assertTrue(FactType.Burial.isDeathLike()); assertTrue(FactType.MarriageBanns.isMarriageLike()); assertTrue(FactType.DivorceFiling.isDivorceLike()); assertTrue(FactType.Naturalization.isMigrationLike()); } @Test public void testFactTypeInnerClasses() throws Exception { // NOTE: not a full test, but gets some code coverage assertTrue(FactType.Person.isApplicable(FactType.Will)); assertTrue(FactType.Couple.isApplicable(FactType.Separation)); assertTrue(FactType.ParentChild.isApplicable(FactType.Guardianship)); } }
<<<<<<< import javax.xml.XMLConstants; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlType; ======= import javax.xml.bind.annotation.*; import java.util.ArrayList; import java.util.List; >>>>>>> import javax.xml.XMLConstants; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlID; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlType; <<<<<<< private String lang; private String subject; private String text; ======= private String id; private TextValue subject; private TextValue text; >>>>>>> private String id; private String lang; private String subject; private String text; <<<<<<< * The language of the note. See <a href="http://www.w3.org/International/articles/language-tags/>http://www.w3.org/International/articles/language-tags/</a> * * @return The language of the note. */ @XmlAttribute ( namespace = XMLConstants.XML_NS_URI ) public String getLang() { return lang; } /** * The language of the note. See <a href="http://www.w3.org/International/articles/language-tags/>http://www.w3.org/International/articles/language-tags/</a> * * @param lang The language of the note. */ public void setLang(String lang) { this.lang = lang; } /** ======= * A local, context-specific id for the data. * * @return A local, context-specific id for the data. */ @XmlID @XmlAttribute public String getId() { return id; } /** * A local, context-specific id for the data. * * @param id A local, context-specific id for the data. */ public void setId(String id) { this.id = id; } /** >>>>>>> * A local, context-specific id for the data. * * @return A local, context-specific id for the data. */ @XmlID @XmlAttribute public String getId() { return id; } /** * A local, context-specific id for the data. * * @param id A local, context-specific id for the data. */ public void setId(String id) { this.id = id; } /** * The language of the note. See <a href="http://www.w3.org/International/articles/language-tags/>http://www.w3.org/International/articles/language-tags/</a> * * @return The language of the note. */ @XmlAttribute ( namespace = XMLConstants.XML_NS_URI ) public String getLang() { return lang; } /** * The language of the note. See <a href="http://www.w3.org/International/articles/language-tags/>http://www.w3.org/International/articles/language-tags/</a> * * @param lang The language of the note. */ public void setLang(String lang) { this.lang = lang; } /**
<<<<<<< /** * Scans the default location for saving local copies of files searching for * a 'lost' file with the same full name as the {@link OCFile} received as * parameter. * * @param file File to associate a possible 'lost' local file. */ private void searchForLocalFileInDefaultPath(OCFile file) { if (file.getStoragePath() == null && !file.isFolder()) { File f = new File(FileStorageUtils.getDefaultSavePathFor(mAccount.name, file)); if (f.exists()) { file.setStoragePath(f.getAbsolutePath()); file.setLastSyncDateForData(f.lastModified()); } } } /** * Sends a message to any application component interested in the progress of the synchronization. * * @param inProgress 'True' when the synchronization progress is not finished. * @param dirRemotePath Remote path of a folder that was just synchronized (with or without success) */ private void sendStickyBroadcast(boolean inProgress, String dirRemotePath, RemoteOperationResult result) { Intent i = new Intent(FileSyncService.getSyncMessage()); i.putExtra(FileSyncService.IN_PROGRESS, inProgress); i.putExtra(FileSyncService.ACCOUNT_NAME, mAccount.name); if (dirRemotePath != null) { i.putExtra(FileSyncService.SYNC_FOLDER_REMOTE_PATH, dirRemotePath); } if (result != null) { i.putExtra(FileSyncService.SYNC_RESULT, result); } mContext.sendStickyBroadcast(i); } public boolean getRemoteFolderChanged() { return mRemoteFolderChanged; } ======= >>>>>>> /** * Scans the default location for saving local copies of files searching for * a 'lost' file with the same full name as the {@link OCFile} received as * parameter. * * @param file File to associate a possible 'lost' local file. */ private void searchForLocalFileInDefaultPath(OCFile file) { if (file.getStoragePath() == null && !file.isFolder()) { File f = new File(FileStorageUtils.getDefaultSavePathFor(mAccount.name, file)); if (f.exists()) { file.setStoragePath(f.getAbsolutePath()); file.setLastSyncDateForData(f.lastModified()); } } } /** * Sends a message to any application component interested in the progress of the synchronization. * * @param inProgress 'True' when the synchronization progress is not finished. * @param dirRemotePath Remote path of a folder that was just synchronized (with or without success) */ private void sendStickyBroadcast(boolean inProgress, String dirRemotePath, RemoteOperationResult result) { Intent i = new Intent(FileSyncService.getSyncMessage()); i.putExtra(FileSyncService.IN_PROGRESS, inProgress); i.putExtra(FileSyncService.ACCOUNT_NAME, mAccount.name); if (dirRemotePath != null) { i.putExtra(FileSyncService.SYNC_FOLDER_REMOTE_PATH, dirRemotePath); } if (result != null) { i.putExtra(FileSyncService.SYNC_RESULT, result); } mContext.sendStickyBroadcast(i); } public boolean getRemoteFolderChanged() { return mRemoteFolderChanged; }
<<<<<<< import javax.xml.namespace.QName; ======= import java.net.URI; >>>>>>> import javax.xml.namespace.QName; import java.net.URI; <<<<<<< propOrder = {"persistentId", "alternateIds", "person1", "person2", "attribution", "events", "characteristics", "sources"} ======= propOrder = {"persistentId", "alternateIds", "attribution", "events", "characteristics", "sources", "extension"} >>>>>>> propOrder = {"persistentId", "alternateIds", "person1", "person2", "attribution", "events", "characteristics", "sources", "extension"} <<<<<<< private QName type; private PersistentId persistentId; ======= private URI persistentId; >>>>>>> private QName type; private URI persistentId; <<<<<<< ======= /** * A person in the relationship. The name "person1" is used only to distinguish it from * the other person in this relationship and implies neither order nor role. When the relationship type * implies direction, it goes from "person1" to "person2". * * @return A person in the relationship. The name "person1" is used only to distinguish it from * the other person in this relationship and implies neither order nor role. When the relationship type * implies direction, it goes from "person1" to "person2". */ @XmlTransient public abstract PersonReference getPerson1(); /** * A person in the relationship. The name "person1" is used only to distinguish it from * the other person in this relationship and implies neither order nor role. When the relationship type * implies direction, it goes from "person1" to "person2". * * @param person1 A person in the relationship. The name "person1" is used only to distinguish it from * the other person in this relationship and implies neither order nor role. When the relationship type * implies direction, it goes from "person1" to "person2". */ public abstract void setPerson1(PersonReference person1); /** * A person in the relationship. The name "person2" is used only to distinguish it from * the other person in this relationship and implies neither order nor role. When the relationship type * implies direction, it goes from "person1" to "person2". * * @return A person in the relationship. The name "person2" is used only to distinguish it from * the other person in this relationship and implies neither order nor role. When the relationship type * implies direction, it goes from "person1" to "person2". */ @XmlTransient public abstract PersonReference getPerson2(); /** * A person in the relationship. The name "person2" is used only to distinguish it from * the other person in this relationship and implies neither order nor role. When the relationship type * implies direction, it goes from "person1" to "person2". * * @param person2 A person in the relationship. The name "person2" is used only to distinguish it from * the other person in this relationship and implies neither order nor role. When the relationship type * implies direction, it goes from "person1" to "person2". */ public abstract void setPerson2(PersonReference person2); /** * The extension point for the relationship. * * @return The extension point for the relationship. */ @XmlElement( name = "ext" ) public Extension getExtension() { return extension; } /** * The extension point for the relationship. * * @param extension The extension point for the relationship. */ public void setExtension(Extension extension) { this.extension = extension; } >>>>>>> /** * The extension point for the relationship. * * @return The extension point for the relationship. */ @XmlElement( name = "ext" ) public Extension getExtension() { return extension; } /** * The extension point for the relationship. * * @param extension The extension point for the relationship. */ public void setExtension(Extension extension) { this.extension = extension; }
<<<<<<< public void onBindParentViewHolder(VerticalParentViewHolder parentViewHolder, int position, ParentListItem parentListItem) { VerticalParentListItem verticalParentListItem = (VerticalParentListItem) parentListItem; parentViewHolder.bind(verticalParentListItem.getParentNumber(), verticalParentListItem.getParentText()); ======= public void onBindParentViewHolder(VerticalParentViewHolder parentViewHolder, int position, Object parentListItem) { VerticalParent verticalParent = (VerticalParent) parentListItem; parentViewHolder.bind(verticalParent.getParentNumber(), verticalParent.getParentText()); >>>>>>> public void onBindParentViewHolder(VerticalParentViewHolder parentViewHolder, int position, ParentListItem parentListItem) { VerticalParent verticalParent = (VerticalParent) parentListItem; parentViewHolder.bind(verticalParent.getParentNumber(), verticalParent.getParentText());
<<<<<<< public void onBindParentViewHolder(HorizontalParentViewHolder parentViewHolder, int position, ParentListItem parentListItem) { HorizontalParentListItem horizontalParentListItem = (HorizontalParentListItem) parentListItem; parentViewHolder.bind(horizontalParentListItem.getParentNumber(), horizontalParentListItem.getParentText()); ======= public void onBindParentViewHolder(HorizontalParentViewHolder parentViewHolder, int position, Object parentListItem) { HorizontalParent horizontalParent = (HorizontalParent) parentListItem; parentViewHolder.bind(horizontalParent.getParentNumber(), horizontalParent.getParentText()); >>>>>>> public void onBindParentViewHolder(HorizontalParentViewHolder parentViewHolder, int position, ParentListItem parentListItem) { HorizontalParent horizontalParent = (HorizontalParent) parentListItem; parentViewHolder.bind(horizontalParent.getParentNumber(), horizontalParent.getParentText());
<<<<<<< import com.owncloud.android.files.services.FileUploadService.FileUploaderBinder; import com.owncloud.android.lib.common.accounts.AccountUtils.Constants; ======= import com.owncloud.android.files.services.FileUploader.FileUploaderBinder; >>>>>>> import com.owncloud.android.files.services.FileUploadService.FileUploaderBinder; import com.owncloud.android.lib.common.accounts.AccountUtils.Constants; <<<<<<< /** * Retry uploading a failed or cancelled upload with force. */ public void retryUpload(UploadDbObject upload) { Account account = mFileActivity.getAccount(); FileUploaderBinder uploaderBinder = mFileActivity.getFileUploaderBinder(); if (uploaderBinder != null) { upload.removeAllUploadRestrictions(); //only this object, upload DB stays untouched. uploaderBinder.retry(account, upload); } else { Log_OC.w(TAG, "uploaderBinder not set. Cannot remove " + upload.getOCFile()); } } /** * Remove upload from upload list. */ public void removeUploadFromList(UploadDbObject upload) { Account account = mFileActivity.getAccount(); FileUploaderBinder uploaderBinder = mFileActivity.getFileUploaderBinder(); if (uploaderBinder != null) { uploaderBinder.remove(account, upload.getOCFile()); } else { Log_OC.w(TAG, "uploaderBinder not set. Cannot remove " + upload.getOCFile()); } } ======= /** * Cancel the transference in downloads (files/folders) and file uploads * @param file OCFile */ >>>>>>> /** * Retry uploading a failed or cancelled upload with force. */ public void retryUpload(UploadDbObject upload) { Account account = mFileActivity.getAccount(); FileUploaderBinder uploaderBinder = mFileActivity.getFileUploaderBinder(); if (uploaderBinder != null) { upload.removeAllUploadRestrictions(); //only this object, upload DB stays untouched. uploaderBinder.retry(account, upload); } else { Log_OC.w(TAG, "uploaderBinder not set. Cannot remove " + upload.getOCFile()); } } /** * Remove upload from upload list. */ public void removeUploadFromList(UploadDbObject upload) { Account account = mFileActivity.getAccount(); FileUploaderBinder uploaderBinder = mFileActivity.getFileUploaderBinder(); if (uploaderBinder != null) { uploaderBinder.remove(account, upload.getOCFile()); } else { Log_OC.w(TAG, "uploaderBinder not set. Cannot remove " + upload.getOCFile()); } } /** * Cancel the transference in downloads (files/folders) and file uploads * @param file OCFile */ <<<<<<< FileUploaderBinder uploaderBinder = mFileActivity.getFileUploaderBinder(); if (downloaderBinder != null) { if (downloaderBinder.isDownloading(account, file)) { // Remove etag for parent, if file is a keep_in_sync if (file.keepInSync()) { OCFile parent = mFileActivity.getStorageManager().getFileById(file.getParentId()); parent.setEtag(""); mFileActivity.getStorageManager().saveFile(parent); } downloaderBinder.cancel(account, file); } else { Log_OC.d(TAG, "Download for " + file + " not in progress. Cannot cancel " + file); } } if (uploaderBinder != null) { if (uploaderBinder.isUploading(account, file)) { uploaderBinder.cancel(account, file); } else { Log_OC.d(TAG, "Upload for " + file + " not in progress. Cannot cancel."); } } if(downloaderBinder == null && uploaderBinder == null) { Log_OC.w(TAG, "Neither downloaderBinder nor uploaderBinder set. Cannot cancel."); ======= FileUploaderBinder uploaderBinder = mFileActivity.getFileUploaderBinder(); if (downloaderBinder != null && downloaderBinder.isDownloading(account, file)) { downloaderBinder.cancel(account, file); // TODO - review why is this here, and solve in a better way // Remove etag for parent, if file is a favorite if (file.isFavorite()) { OCFile parent = mFileActivity.getStorageManager().getFileById(file.getParentId()); parent.setEtag(""); mFileActivity.getStorageManager().saveFile(parent); } } else if (uploaderBinder != null && uploaderBinder.isUploading(account, file)) { uploaderBinder.cancel(account, file); >>>>>>> FileUploaderBinder uploaderBinder = mFileActivity.getFileUploaderBinder(); if (downloaderBinder != null) { if (downloaderBinder.isDownloading(account, file)) { // Remove etag for parent, if file is a keep_in_sync if (file.isFavorite()) { OCFile parent = mFileActivity.getStorageManager().getFileById(file.getParentId()); parent.setEtag(""); mFileActivity.getStorageManager().saveFile(parent); } downloaderBinder.cancel(account, file); } else { Log_OC.d(TAG, "Download for " + file + " not in progress. Cannot cancel " + file); } } if (uploaderBinder != null) { if (uploaderBinder.isUploading(account, file)) { uploaderBinder.cancel(account, file); } else { Log_OC.d(TAG, "Upload for " + file + " not in progress. Cannot cancel."); } } if(downloaderBinder == null && uploaderBinder == null) { Log_OC.w(TAG, "Neither downloaderBinder nor uploaderBinder set. Cannot cancel.");
<<<<<<< public void onBindParentViewHolder(RecipeViewHolder recipeViewHolder, int parentPosition, Recipe recipe) { ======= public void onBindParentViewHolder(@NonNull RecipeViewHolder recipeViewHolder, int parentPosition, @NonNull ParentListItem parentListItem) { Recipe recipe = (Recipe) parentListItem; >>>>>>> public void onBindParentViewHolder(@NonNull RecipeViewHolder recipeViewHolder, int parentPosition, @NonNull Recipe recipe) { <<<<<<< public void onBindChildViewHolder(IngredientViewHolder ingredientViewHolder, int parentPosition, int childPosition, Ingredient ingredient) { ======= public void onBindChildViewHolder(@NonNull IngredientViewHolder ingredientViewHolder, int parentPosition, int childPosition, @NonNull Object childListItem) { Ingredient ingredient = (Ingredient) childListItem; >>>>>>> public void onBindChildViewHolder(@NonNull IngredientViewHolder ingredientViewHolder, int parentPosition, int childPosition, @NonNull Ingredient ingredient) {
<<<<<<< import android.view.View; import android.widget.AdapterView; import android.widget.Button; import android.widget.CheckBox; import android.widget.CompoundButton; import android.widget.Spinner; ======= >>>>>>> import android.view.View; import android.widget.Button; <<<<<<< private CheckBox mAnimationEnabledCheckBox; private Spinner mToolbarSpinner; private Button mExpandParentTwoButton; private Button mCollapseParentTwoButton; private Button mExpandAllButton; private Button mCollapseAllButton; ======= >>>>>>> private Button mExpandParentTwoButton; private Button mCollapseParentTwoButton; private Button mExpandAllButton; private Button mCollapseAllButton; private List<ParentObject> mTestDataObjectList; <<<<<<< private ArrayList<Long> mDurationList; private List<ParentObject> mTestDataObjectList; ======= >>>>>>> <<<<<<< mAnimationEnabledCheckBox = (CheckBox) findViewById(R.id.toolbar_sample_checkBox); mAnimationEnabledCheckBox.setOnCheckedChangeListener(mAnimationEnabledCheckedChangeListener); mToolbarSpinner = (Spinner) findViewById(R.id.toolbar_sample_spinner); mToolbarSpinner.setOnItemSelectedListener(mToolbarSpinnerItemSelectListener); mExpandParentTwoButton = (Button) findViewById(R.id.activity_horizontal_linear_recycler_view_expand_parent_two_button); mExpandParentTwoButton.setOnClickListener(mExpandParentTwoClickListener); mCollapseParentTwoButton = (Button) findViewById(R.id.activity_horizontal_linear_recycler_view_collapse_parent_two_button); mCollapseParentTwoButton.setOnClickListener(mCollapseParentTwoClickListener); mExpandAllButton = (Button) findViewById(R.id.activity_horizontal_linear_recycler_view_expand_all_button); mExpandAllButton.setOnClickListener(mExpandAllClickListener); mCollapseAllButton = (Button) findViewById(R.id.activity_horizontal_linear_recycler_view_collapse_all_button); mCollapseAllButton.setOnClickListener(mCollapseAllClickListener); // Generate spinner's list of rotation speeds (in ms) mDurationList = generateSpinnerSpeeds(); ======= >>>>>>> mExpandParentTwoButton = (Button) findViewById(R.id.activity_horizontal_linear_recycler_view_expand_parent_two_button); mExpandParentTwoButton.setOnClickListener(mExpandParentTwoClickListener); mCollapseParentTwoButton = (Button) findViewById(R.id.activity_horizontal_linear_recycler_view_collapse_parent_two_button); mCollapseParentTwoButton.setOnClickListener(mCollapseParentTwoClickListener); mExpandAllButton = (Button) findViewById(R.id.activity_horizontal_linear_recycler_view_expand_all_button); mExpandAllButton.setOnClickListener(mExpandAllClickListener); mCollapseAllButton = (Button) findViewById(R.id.activity_horizontal_linear_recycler_view_collapse_all_button); mCollapseAllButton.setOnClickListener(mCollapseAllClickListener); <<<<<<< private CompoundButton.OnCheckedChangeListener mAnimationEnabledCheckedChangeListener = new CompoundButton.OnCheckedChangeListener() { @Override public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { if (isChecked) { // Only the custom triggering view can trigger expansion mExpandableAdapter.setParentAndIconExpandOnClick(false); } else { // Both the custom triggering view and the parent item can trigger expansion mExpandableAdapter.setParentAndIconExpandOnClick(true); } mExpandableAdapter.setCustomParentAnimationViewId(R.id.list_item_parent_horizontal_arrow_imageView); mExpandableAdapter.setParentClickableViewAnimationDuration((Long) mToolbarSpinner.getSelectedItem()); mExpandableAdapter.notifyDataSetChanged(); } }; private AdapterView.OnItemSelectedListener mToolbarSpinnerItemSelectListener = new AdapterView.OnItemSelectedListener() { @Override public void onItemSelected(AdapterView<?> parent, View view, int position, long id) { if (mAnimationEnabledCheckBox.isChecked()) { enableCustomExpandButton(position); } else { disableCustomExpandButton(position); } mExpandableAdapter.notifyDataSetChanged(); } @Override public void onNothingSelected(AdapterView<?> parent) { // Do nothing } }; private View.OnClickListener mExpandParentTwoClickListener = new View.OnClickListener() { @Override public void onClick(View v) { // mExpandableAdapter.expandParent(EXPAND_COLLAPSE_SINGLE_PARENT_INDEX); mExpandableAdapter.expandParent(mTestDataObjectList.get(EXPAND_COLLAPSE_SINGLE_PARENT_INDEX)); } }; private View.OnClickListener mCollapseParentTwoClickListener = new View.OnClickListener() { @Override public void onClick(View v) { // mExpandableAdapter.collapseParent(EXPAND_COLLAPSE_SINGLE_PARENT_INDEX); mExpandableAdapter.collapseParent(mTestDataObjectList.get(EXPAND_COLLAPSE_SINGLE_PARENT_INDEX)); } }; private View.OnClickListener mExpandAllClickListener = new View.OnClickListener() { @Override public void onClick(View v) { mExpandableAdapter.expandAllParents(); } }; private View.OnClickListener mCollapseAllClickListener = new View.OnClickListener() { @Override public void onClick(View v) { mExpandableAdapter.collapseAllParents(); } }; ======= >>>>>>> private View.OnClickListener mExpandParentTwoClickListener = new View.OnClickListener() { @Override public void onClick(View v) { // mExpandableAdapter.expandParent(EXPAND_COLLAPSE_SINGLE_PARENT_INDEX); mExpandableAdapter.expandParent(mTestDataObjectList.get(EXPAND_COLLAPSE_SINGLE_PARENT_INDEX)); } }; private View.OnClickListener mCollapseParentTwoClickListener = new View.OnClickListener() { @Override public void onClick(View v) { // mExpandableAdapter.collapseParent(EXPAND_COLLAPSE_SINGLE_PARENT_INDEX); mExpandableAdapter.collapseParent(mTestDataObjectList.get(EXPAND_COLLAPSE_SINGLE_PARENT_INDEX)); } }; private View.OnClickListener mExpandAllClickListener = new View.OnClickListener() { @Override public void onClick(View v) { mExpandableAdapter.expandAllParents(); } }; private View.OnClickListener mCollapseAllClickListener = new View.OnClickListener() { @Override public void onClick(View v) { mExpandableAdapter.collapseAllParents(); } };
<<<<<<< import mikera.matrixx.Matrixx; import mikera.matrixx.algo.decompose.chol.ICholeskyResult; import mikera.matrixx.algo.decompose.chol.impl.CholeskyResult; import mikera.util.Maths; ======= import mikera.matrixx.algo.decompose.chol.ICholesky; import mikera.matrixx.algo.decompose.chol.impl.SimpleCholesky; >>>>>>> import mikera.matrixx.algo.decompose.chol.ICholeskyResult; import mikera.matrixx.algo.decompose.chol.impl.SimpleCholesky; <<<<<<< public static final ICholeskyResult decompose(AMatrix a) { return decompose(a.toMatrix()); ======= public static final ICholesky decompose(AMatrix a) { return SimpleCholesky.decompose(a.toMatrix()); >>>>>>> public static final ICholeskyResult decompose(AMatrix a) { return SimpleCholesky.decompose(a.toMatrix()); <<<<<<< public static final ICholeskyResult decompose(Matrix a) { if (!a.isSquare()) throw new IllegalArgumentException("Matrix must be square for Cholesky decomposition"); int n=a.rowCount(); Matrix u=Matrix.create(n,n); for (int i=0; i<n;i++) { double squareSum=0.0; for (int j=0; j<i; j++) { double crossSum=0.0; for (int k=0; k<j; k++) { crossSum+=u.get(i,k)*u.get(j,k); } final double aij=a.get(i,j); double uij=(aij-crossSum)/u.get(j,j); u.set(i,j,uij); squareSum+=uij*uij; } double aii =a.get(i,i); double uii=Maths.sqrt(aii-squareSum); u.set(i,i,uii); } // TODO: should be null return for a failed decomposition? AMatrix L = Matrixx.extractLowerTriangular(u); return new CholeskyResult(L); ======= /** * Decompose a Matrix according the the Cholesky decomposition A = L.L* * * @param a Any symmetric, positive definite matrix * @return The decomposition result, or null if not possible */ public static final ICholesky decompose(Matrix a) { return SimpleCholesky.decompose(a); >>>>>>> /** * Decompose a Matrix according the the Cholesky decomposition A = L.L* * * @param a Any symmetric, positive definite matrix * @return The decomposition result, or null if not possible */ public static final ICholeskyResult decompose(Matrix a) { return SimpleCholesky.decompose(a);
<<<<<<< import com.owncloud.android.authentication.AccountAuthenticator; ======= import com.owncloud.android.Log_OC; import com.owncloud.android.authenticator.AccountAuthenticator; >>>>>>> import com.owncloud.android.authentication.AccountAuthenticator; import com.owncloud.android.Log_OC;
<<<<<<< import android.widget.AdapterView; import android.widget.AdapterView.OnItemClickListener; import android.widget.GridView; ======= import android.widget.ImageView; import android.widget.ListView; >>>>>>> import android.widget.AdapterView; import android.widget.AdapterView.OnItemClickListener; import android.widget.GridView; import android.widget.ImageView; <<<<<<< private AlarmGridView mView; private AlarmListAdapter mAdapter; ======= private static final int[] attrs = new int[] { R.attr.ic_action_search /* * index * 0 */}; private AlarmListAdapter adapter; >>>>>>> private AlarmGridView mView; private AlarmListAdapter mAdapter; <<<<<<< case R.id.action_settings: Intent intent = new Intent(this, SettingsActivity.class); startActivityForResult(intent, REQUEST_SETTINGS); return true; case R.id.action_about: (new AboutDialogFragment()).show(getFragmentManager(), "about"); return true; default: return super.onOptionsItemSelected(item); ======= case R.id.action_add_alarm: startActivityForResult(new Intent(this, AlarmCreationActivity.class), REQUEST_CREATE); return true; case R.id.action_settings: startActivityForResult(new Intent(this, SettingsActivity.class), REQUEST_SETTINGS); return true; case R.id.action_about: (new AboutDialogFragment()).show(getFragmentManager(), "about"); return true; default: return super.onOptionsItemSelected(item); } } @Override protected void onListItemClick(ListView l, View v, int position, long layout) { Alarm alarm = adapter.getItem(position); Intent alarmSettingsIntent = new Intent(this, AlarmSettingsActivity.class); alarmSettingsIntent.putExtra(AlarmSettingsActivity.alarmID, alarm.getId()); alarmSettingsIntent.putExtra(AlarmSettingsActivity.alarmType, alarm.getClass().getSimpleName()); if(!alarm.isOn()){ v.setBackgroundColor(getResources().getColor(R.color.highlightblue)); >>>>>>> case R.id.action_add_alarm: startActivityForResult(new Intent(this, AlarmCreationActivity.class), REQUEST_CREATE); return true; case R.id.action_settings: startActivityForResult(new Intent(this, SettingsActivity.class), REQUEST_SETTINGS); return true; case R.id.action_about: (new AboutDialogFragment()).show(getFragmentManager(), "about"); return true; default: return super.onOptionsItemSelected(item);
<<<<<<< import com.twitter.elephantbird.mapreduce.input.LzoInputFormat; import com.twitter.elephantbird.mapreduce.io.ThriftB64LineWritable; import com.twitter.elephantbird.util.TypeRef; ======= import com.twitter.elephantbird.mapreduce.io.ThriftWritable; import com.twitter.elephantbird.util.ThriftUtils; import com.twitter.elephantbird.util.TypeRef; import org.apache.hadoop.conf.Configuration; >>>>>>> import org.apache.hadoop.conf.Configuration;
<<<<<<< import org.junit.Test; import static org.junit.Assert.assertEquals; ======= >>>>>>>
<<<<<<< private Message msgInstance; private Builder msgBuilder; private boolean readUnknownsColumn = false; private List<FieldDescriptor> knownRequiredFields = Lists.newArrayList(); private ArrayList<Integer> columnsBeingRead = Lists.newArrayList(); ======= protected Builder msgBuilder; protected boolean readUnknownsColumn = false; protected List<FieldDescriptor> knownRequiredFields = Lists.newArrayList(); protected ArrayList<Integer> columnsBeingRead = Lists.newArrayList(); >>>>>>> protected Message msgInstance; protected Builder msgBuilder; protected boolean readUnknownsColumn = false; protected List<FieldDescriptor> knownRequiredFields = Lists.newArrayList(); protected ArrayList<Integer> columnsBeingRead = Lists.newArrayList(); <<<<<<< msgInstance = msgBuilder.getDefaultInstanceForType(); ======= protoWritable = ProtobufWritable.newInstance(typeRef.getRawClass()); >>>>>>> msgInstance = msgBuilder.getDefaultInstanceForType(); protoWritable = ProtobufWritable.newInstance(typeRef.getRawClass()); <<<<<<< currentValue = builder.build(); return currentValue; } /** * Returns a Tuple consisting of required fields with out creating * a Protobuf message at the top level. */ public Tuple getCurrentTupleValue() throws IOException, InterruptedException { BytesRefArrayWritable byteRefs = getCurrentValue(); if (byteRefs == null) { return null; } Tuple tuple = tf.newTuple(knownRequiredFields.size()); for (int i=0; i < knownRequiredFields.size(); i++) { BytesRefWritable buf = byteRefs.get(columnsBeingRead.get(i)); FieldDescriptor fd = knownRequiredFields.get(i); Object value = null; if (buf.getLength() > 0) { value = Protobufs.readFieldNoTag( CodedInputStream.newInstance(buf.getData(), buf.getStart(), buf.getLength()), knownRequiredFields.get(i), msgBuilder); } else { // use the value from default instance value = msgInstance.getField(fd); } tuple.set(i, protoToPig.fieldToPig(fd, value)); } if (readUnknownsColumn) { // we can handle this if needed. throw new IOException("getCurrentTupleValue() is not supported when 'readUnknownColumns' is set"); } return tuple; ======= return builder.build(); >>>>>>> return builder.build();
<<<<<<< public LzoJsonLoader() { LOG.debug("LzoJsonLoader creation"); } public void skipToNextSyncPoint(boolean atFirstRecord) throws IOException { // Since we are not block aligned we throw away the first record of each split and count on a different // instance to read it. The only split this doesn't work for is the first. if (!atFirstRecord) { getNext(); } } ======= public LzoJsonLoader() {} >>>>>>> public LzoJsonLoader() { LOG.debug("LzoJsonLoader creation"); } <<<<<<< ======= @Override public void setLocation(String location, Job job) throws IOException { FileInputFormat.setInputPaths(job, location); } >>>>>>> @Override public void setLocation(String location, Job job) throws IOException { FileInputFormat.setInputPaths(job, location); }
<<<<<<< ======= import org.apache.hadoop.conf.Configuration; >>>>>>> import org.apache.hadoop.conf.Configuration;
<<<<<<< import org.apache.thrift.meta_data.FieldValueMetaData; import org.apache.thrift.meta_data.ListMetaData; import org.apache.thrift.meta_data.MapMetaData; import org.apache.thrift.meta_data.SetMetaData; ======= >>>>>>>
<<<<<<< private final Map<Path, LzoIndex> indexes_ = new HashMap<Path, LzoIndex>(); private final PathFilter hiddenPathFilter = new PathFilter() { // avoid hidden files and directories. @Override public boolean accept(Path path) { String name = path.getName(); return !name.startsWith(".") && !name.startsWith("_"); } }; ======= private final PathFilter visibleLzoFilter = new PathFilter() { >>>>>>> private final PathFilter hiddenPathFilter = new PathFilter() { // avoid hidden files and directories. @Override public boolean accept(Path path) { String name = path.getName(); return !name.startsWith(".") && !name.startsWith("_"); } }; <<<<<<< LOG.debug("Total lzo input paths to process : " + results.size()); // To help split the files at LZO boundaries, walk the list of lzo files and, if they // have an associated index file, save that for later. for (FileStatus result : results) { LzoIndex index = LzoIndex.readIndex(result.getPath().getFileSystem(job.getConfiguration()), result.getPath()); indexes_.put(result.getPath(), index); } ======= >>>>>>> LOG.debug("Total lzo input paths to process : " + results.size());
<<<<<<< import de.fu_berlin.inf.dpp.awareness.IDEInteractionActivitiesManager; import de.fu_berlin.inf.dpp.awareness.IDEInteractionActivitiesListener; ======= import de.fu_berlin.inf.dpp.awareness.AwarenessInformationCollector; >>>>>>> import de.fu_berlin.inf.dpp.awareness.AwarenessInformationCollector; import de.fu_berlin.inf.dpp.awareness.IDEInteractionActivitiesListener; import de.fu_berlin.inf.dpp.awareness.IDEInteractionActivitiesManager;
<<<<<<< // FIXME should be passed in (colorID, nickname) final SarosSession sarosSession = new SarosSession(sessionID, preferences.getSessionNickname(), preferences.getFavoriteColorID(), sarosContext); ======= // FIXME should be passed in (colorID) final SarosSession sarosSession = new SarosSession( preferenceUtils.getFavoriteColorID(), sarosContext); >>>>>>> final SarosSession sarosSession = new SarosSession(sessionID, preferences.getFavoriteColorID(), sarosContext); <<<<<<< SarosSession sarosSession = new SarosSession(id, host, clientNickname, hostNickname, clientColor, hostColor, sarosContext); ======= SarosSession sarosSession = new SarosSession(host, clientColor, hostColor, sarosContext); >>>>>>> SarosSession sarosSession = new SarosSession(id, host, clientColor, hostColor, sarosContext);
<<<<<<< ======= import java.util.ArrayList; >>>>>>> <<<<<<< public class ExtendedListFragment extends SherlockFragment implements OnItemClickListener { ======= public class ExtendedListFragment extends SherlockFragment implements OnItemClickListener, OnEnforceableRefreshListener { >>>>>>> public class ExtendedListFragment extends SherlockFragment implements OnItemClickListener, OnEnforceableRefreshListener { <<<<<<< private static final String KEY_SAVED_LIST_POSITION = "SAVED_LIST_POSITION"; ======= private static final String KEY_SAVED_LIST_POSITION = "SAVED_LIST_POSITION"; private static final String KEY_INDEXES = "INDEXES"; private static final String KEY_FIRST_POSITIONS= "FIRST_POSITIONS"; private static final String KEY_TOPS = "TOPS"; private static final String KEY_HEIGHT_CELL = "HEIGHT_CELL"; private static final String KEY_EMPTY_LIST_MESSAGE = "EMPTY_LIST_MESSAGE"; >>>>>>> private static final String KEY_SAVED_LIST_POSITION = "SAVED_LIST_POSITION"; private static final String KEY_INDEXES = "INDEXES"; private static final String KEY_FIRST_POSITIONS= "FIRST_POSITIONS"; private static final String KEY_TOPS = "TOPS"; private static final String KEY_HEIGHT_CELL = "HEIGHT_CELL"; private static final String KEY_EMPTY_LIST_MESSAGE = "EMPTY_LIST_MESSAGE"; <<<<<<< ======= private SwipeRefreshLayout mRefreshLayout; private SwipeRefreshLayout mRefreshEmptyLayout; private TextView mEmptyListMessage; // Save the state of the scroll in browsing private ArrayList<Integer> mIndexes; private ArrayList<Integer> mFirstPositions; private ArrayList<Integer> mTops; private int mHeightCell = 0; private OnEnforceableRefreshListener mOnRefreshListener = null; >>>>>>> private SwipeRefreshLayout mRefreshLayout; private SwipeRefreshLayout mRefreshEmptyLayout; private TextView mEmptyListMessage; // Save the state of the scroll in browsing private ArrayList<Integer> mIndexes; private ArrayList<Integer> mFirstPositions; private ArrayList<Integer> mTops; private int mHeightCell = 0; private OnEnforceableRefreshListener mOnRefreshListener = null; <<<<<<< // mList = new ExtendedListView(getActivity()); ======= >>>>>>> <<<<<<< mList = (ExtendedListView) (v.findViewById(R.id.list_root)); ======= mEmptyListMessage = (TextView) v.findViewById(R.id.empty_list_view); mList = (ExtendedListView)(v.findViewById(R.id.list_root)); >>>>>>> mEmptyListMessage = (TextView) v.findViewById(R.id.empty_list_view); mList = (ExtendedListView) (v.findViewById(R.id.list_root)); <<<<<<< // mList.setEmptyView(v.findViewById(R.id.empty_list_view)); // looks // like it's not a cool idea ======= >>>>>>> <<<<<<< ======= // Pull down refresh mRefreshLayout = (SwipeRefreshLayout) v.findViewById(R.id.swipe_refresh_files); mRefreshEmptyLayout = (SwipeRefreshLayout) v.findViewById(R.id.swipe_refresh_files_emptyView); onCreateSwipeToRefresh(mRefreshLayout); onCreateSwipeToRefresh(mRefreshEmptyLayout); mList.setEmptyView(mRefreshEmptyLayout); >>>>>>> // Pull down refresh mRefreshLayout = (SwipeRefreshLayout) v.findViewById(R.id.swipe_refresh_files); mRefreshEmptyLayout = (SwipeRefreshLayout) v.findViewById(R.id.swipe_refresh_files_emptyView); onCreateSwipeToRefresh(mRefreshLayout); onCreateSwipeToRefresh(mRefreshEmptyLayout); mList.setEmptyView(mRefreshEmptyLayout); <<<<<<< ======= /** * {@inheritDoc} */ @Override public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); if (savedInstanceState != null) { mIndexes = savedInstanceState.getIntegerArrayList(KEY_INDEXES); mFirstPositions = savedInstanceState.getIntegerArrayList(KEY_FIRST_POSITIONS); mTops = savedInstanceState.getIntegerArrayList(KEY_TOPS); mHeightCell = savedInstanceState.getInt(KEY_HEIGHT_CELL); setMessageForEmptyList(savedInstanceState.getString(KEY_EMPTY_LIST_MESSAGE)); } else { mIndexes = new ArrayList<Integer>(); mFirstPositions = new ArrayList<Integer>(); mTops = new ArrayList<Integer>(); mHeightCell = 0; } } >>>>>>> /** * {@inheritDoc} */ @Override public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); if (savedInstanceState != null) { mIndexes = savedInstanceState.getIntegerArrayList(KEY_INDEXES); mFirstPositions = savedInstanceState.getIntegerArrayList(KEY_FIRST_POSITIONS); mTops = savedInstanceState.getIntegerArrayList(KEY_TOPS); mHeightCell = savedInstanceState.getInt(KEY_HEIGHT_CELL); setMessageForEmptyList(savedInstanceState.getString(KEY_EMPTY_LIST_MESSAGE)); } else { mIndexes = new ArrayList<Integer>(); mFirstPositions = new ArrayList<Integer>(); mTops = new ArrayList<Integer>(); mHeightCell = 0; } }
<<<<<<< import com.mercadopago.android.px.internal.features.Constants; ======= >>>>>>> import com.mercadopago.android.px.internal.features.Constants; <<<<<<< private void startReviewPaymentMethodsActivity(List<PaymentMethod> supportedPaymentMethods) { new Constants.Activities.ReviewPaymentMethodsActivityBuilder() ======= private void startReviewPaymentMethodsActivity(final List<PaymentMethod> supportedPaymentMethods) { new MercadoPagoComponents.Activities.ReviewPaymentMethodsActivityBuilder() >>>>>>> private void startReviewPaymentMethodsActivity(final List<PaymentMethod> supportedPaymentMethods) { new Constants.Activities.ReviewPaymentMethodsActivityBuilder() <<<<<<< public void askForPaymentType() { List<PaymentMethod> paymentMethods = mPresenter.getGuessedPaymentMethods(); List<PaymentType> paymentTypes = mPresenter.getPaymentTypes(); new Constants.Activities.PaymentTypesActivityBuilder() ======= public void askForPaymentType(final List<PaymentMethod> paymentMethods, final List<PaymentType> paymentTypes, final CardInfo cardInfo) { new MercadoPagoComponents.Activities.PaymentTypesActivityBuilder() >>>>>>> public void askForPaymentType(final List<PaymentMethod> paymentMethods, final List<PaymentType> paymentTypes, final CardInfo cardInfo) { new Constants.Activities.PaymentTypesActivityBuilder() <<<<<<< if (requestCode == Constants.Activities.PAYMENT_TYPES_REQUEST_CODE) { if (resultCode == RESULT_OK) { Bundle bundle = data.getExtras(); PaymentType paymentType = JsonUtil.getInstance().fromJson(bundle.getString("paymentType"), PaymentType.class); mPresenter.setSelectedPaymentType(paymentType); showFinishCardFlow(); ======= if (requestCode == MercadoPagoComponents.Activities.PAYMENT_TYPES_REQUEST_CODE) { if (resultCode == RESULT_OK && data != null && data.getExtras() != null) { final Bundle bundle = data.getExtras(); final String paymentTypeJson = bundle.getString("paymentType"); if (!TextUtils.isEmpty(paymentTypeJson)) { final PaymentType paymentType = JsonUtil.getInstance().fromJson(paymentTypeJson, PaymentType.class); mPresenter.setSelectedPaymentType(paymentType); showFinishCardFlow(); } >>>>>>> if (requestCode == Constants.Activities.PAYMENT_TYPES_REQUEST_CODE) { if (resultCode == RESULT_OK && data != null && data.getExtras() != null) { final Bundle bundle = data.getExtras(); final String paymentTypeJson = bundle.getString("paymentType"); if (!TextUtils.isEmpty(paymentTypeJson)) { final PaymentType paymentType = JsonUtil.getInstance().fromJson(paymentTypeJson, PaymentType.class); mPresenter.setSelectedPaymentType(paymentType); showFinishCardFlow(); }
<<<<<<< import com.mercadopago.android.px.internal.viewmodel.CardDrawerConfiguration; ======= import com.mercadopago.android.px.internal.util.ResourceUtil; import com.mercadopago.android.px.internal.util.TextUtil; >>>>>>> import com.mercadopago.android.px.internal.util.TextUtil; import com.mercadopago.android.px.internal.viewmodel.CardDrawerConfiguration; <<<<<<< cardView.getCard().setName(card.getName()); cardView.getCard().setExpiration(card.getDate()); cardView.getCard().setNumber(card.getNumber()); cardView.show(card); ======= cardView.getCard().setName(model.card.getName()); cardView.getCard().setExpiration(model.card.getDate()); cardView.getCard().setNumber(model.card.getNumber()); cardView.show(model.card); cardView.setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS); } @Override protected String getAccessibilityContentDescription() { final SpannableStringBuilder builder = new SpannableStringBuilder(); builder .append(model.paymentMethodId) .append(TextUtil.SPACE) .append(model.getIssuerName()) .append(TextUtil.SPACE) .append(model.getDescription()) .append(TextUtil.SPACE) .append(getString(R.string.px_date_divider)) .append(TextUtil.SPACE) .append(model.card.getName()); return builder.toString(); } protected void setIssuerIcon(@NonNull final Context context, @NonNull final SavedCardDrawableFragmentItem drawableCard) { final int issuerResource = ResourceUtil.getCardIssuerImage(context, drawableCard.card.getIssuerImageName()); if (issuerResource > 0) { drawableCard.card.setIssuerRes(issuerResource); } } private void setPaymentMethodIcon(@NonNull final Context context, @NonNull final SavedCardDrawableFragmentItem drawableCard) { final int paymentMethodResource = ResourceUtil.getCardImage(context, drawableCard.paymentMethodId); if (paymentMethodResource > 0) { drawableCard.card.setLogoRes(paymentMethodResource); } >>>>>>> cardView.getCard().setName(card.getName()); cardView.getCard().setExpiration(card.getDate()); cardView.getCard().setNumber(card.getNumber()); cardView.show(card); cardView.setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS); } @Override protected String getAccessibilityContentDescription() { final SpannableStringBuilder builder = new SpannableStringBuilder(); builder .append(model.paymentMethodId) .append(TextUtil.SPACE) .append(model.getIssuerName()) .append(TextUtil.SPACE) .append(model.getDescription()) .append(TextUtil.SPACE) .append(getString(R.string.px_date_divider)) .append(TextUtil.SPACE) .append(model.card.getName()); return builder.toString();
<<<<<<< import java.io.File; import java.lang.ref.WeakReference; import java.util.Collections; import java.util.Comparator; ======= >>>>>>> import java.io.File; import java.util.Collections; import java.util.Comparator; <<<<<<< import android.content.SharedPreferences; import android.content.res.Resources; ======= >>>>>>> import android.content.SharedPreferences; <<<<<<< import android.graphics.Bitmap.CompressFormat; import android.graphics.BitmapFactory; import android.graphics.drawable.BitmapDrawable; import android.graphics.drawable.Drawable; import android.media.ThumbnailUtils; import android.os.AsyncTask; import android.preference.PreferenceManager; import android.util.TypedValue; ======= >>>>>>> import android.preference.PreferenceManager; <<<<<<< appPreferences = PreferenceManager .getDefaultSharedPreferences(mContext); // Read sorting order, default to sort by name ascending sortOrder = appPreferences .getInt("sortOrder", 0); sortAscending = appPreferences.getBoolean("sortAscending", true); defaultImg = BitmapFactory.decodeResource(mContext.getResources(), DisplayUtils.getResourceId("image/png", "default.png")); ======= >>>>>>> appPreferences = PreferenceManager .getDefaultSharedPreferences(mContext); // Read sorting order, default to sort by name ascending sortOrder = appPreferences .getInt("sortOrder", 0); sortAscending = appPreferences.getBoolean("sortAscending", true); <<<<<<< static class AsyncDrawable extends BitmapDrawable { private final WeakReference<ThumbnailGenerationTask> bitmapWorkerTaskReference; public AsyncDrawable(Resources res, Bitmap bitmap, ThumbnailGenerationTask bitmapWorkerTask) { super(res, bitmap); bitmapWorkerTaskReference = new WeakReference<ThumbnailGenerationTask>(bitmapWorkerTask); } public ThumbnailGenerationTask getBitmapWorkerTask() { return bitmapWorkerTaskReference.get(); } } class ThumbnailGenerationTask extends AsyncTask<OCFile, Void, Bitmap> { private final WeakReference<ImageView> imageViewReference; private OCFile file; public ThumbnailGenerationTask(ImageView imageView) { // Use a WeakReference to ensure the ImageView can be garbage collected imageViewReference = new WeakReference<ImageView>(imageView); } // Decode image in background. @Override protected Bitmap doInBackground(OCFile... params) { Bitmap thumbnail = null; try { file = params[0]; final String imageKey = String.valueOf(file.getRemoteId()); // Check disk cache in background thread thumbnail = getBitmapFromDiskCache(imageKey); // Not found in disk cache if (thumbnail == null || file.needsUpdateThumbnail()) { // Converts dp to pixel Resources r = mContext.getResources(); int px = (int) Math.round(TypedValue.applyDimension( TypedValue.COMPLEX_UNIT_DIP, 150, r.getDisplayMetrics() )); if (file.isDown()){ Bitmap bitmap = BitmapUtils.decodeSampledBitmapFromFile( file.getStoragePath(), px, px); if (bitmap != null) { thumbnail = ThumbnailUtils.extractThumbnail(bitmap, px, px); // Add thumbnail to cache addBitmapToCache(imageKey, thumbnail); file.setNeedsUpdateThumbnail(false); mStorageManager.saveFile(file); } } } } catch (Throwable t) { // the app should never break due to a problem with thumbnails Log_OC.e(TAG, "Generation of thumbnail for " + file + " failed", t); if (t instanceof OutOfMemoryError) { System.gc(); } } return thumbnail; } protected void onPostExecute(Bitmap bitmap){ if (isCancelled()) { bitmap = null; } if (imageViewReference != null && bitmap != null) { final ImageView imageView = imageViewReference.get(); final ThumbnailGenerationTask bitmapWorkerTask = getBitmapWorkerTask(imageView); if (this == bitmapWorkerTask && imageView != null) { imageView.setImageBitmap(bitmap); } } } } public void addBitmapToCache(String key, Bitmap bitmap) { synchronized (thumbnailDiskCacheLock) { if (mThumbnailCache != null) { mThumbnailCache.put(key, bitmap); } } } public Bitmap getBitmapFromDiskCache(String key) { synchronized (thumbnailDiskCacheLock) { // Wait while disk cache is started from background thread while (mThumbnailCacheStarting) { try { thumbnailDiskCacheLock.wait(); } catch (InterruptedException e) {} } if (mThumbnailCache != null) { return (Bitmap) mThumbnailCache.getBitmap(key); } } return null; } ======= >>>>>>> <<<<<<< public static boolean cancelPotentialWork(OCFile file, ImageView imageView) { final ThumbnailGenerationTask bitmapWorkerTask = getBitmapWorkerTask(imageView); if (bitmapWorkerTask != null) { final OCFile bitmapData = bitmapWorkerTask.file; // If bitmapData is not yet set or it differs from the new data if (bitmapData == null || bitmapData != file) { // Cancel previous task bitmapWorkerTask.cancel(true); } else { // The same work is already in progress return false; } } // No task associated with the ImageView, or an existing task was cancelled return true; } private static ThumbnailGenerationTask getBitmapWorkerTask(ImageView imageView) { if (imageView != null) { final Drawable drawable = imageView.getDrawable(); if (drawable instanceof AsyncDrawable) { final AsyncDrawable asyncDrawable = (AsyncDrawable) drawable; return asyncDrawable.getBitmapWorkerTask(); } } return null; } /** * Local Folder size in human readable format * @param path String * @return Size in human readable format */ private String getFolderSizeHuman(String path) { File dir = new File(path); if(dir.exists()) { long bytes = getFolderSize(dir); if (bytes < 1024) return bytes + " B"; int exp = (int) (Math.log(bytes) / Math.log(1024)); String pre = ("KMGTPE").charAt(exp-1) + ""; return String.format("%.1f %sB", bytes / Math.pow(1024, exp), pre); } return "0 B"; } /** * Local Folder size * @param dir File * @return Size in bytes */ private long getFolderSize(File dir) { if (dir.exists()) { long result = 0; File[] fileList = dir.listFiles(); for(int i = 0; i < fileList.length; i++) { if(fileList[i].isDirectory()) { result += getFolderSize(fileList[i]); } else { result += fileList[i].length(); } } return result; } return 0; } ======= >>>>>>> /** * Local Folder size in human readable format * @param path String * @return Size in human readable format */ private String getFolderSizeHuman(String path) { File dir = new File(path); if(dir.exists()) { long bytes = getFolderSize(dir); if (bytes < 1024) return bytes + " B"; int exp = (int) (Math.log(bytes) / Math.log(1024)); String pre = ("KMGTPE").charAt(exp-1) + ""; return String.format("%.1f %sB", bytes / Math.pow(1024, exp), pre); } return "0 B"; } /** * Local Folder size * @param dir File * @return Size in bytes */ private long getFolderSize(File dir) { if (dir.exists()) { long result = 0; File[] fileList = dir.listFiles(); for(int i = 0; i < fileList.length; i++) { if(fileList[i].isDirectory()) { result += getFolderSize(fileList[i]); } else { result += fileList[i].length(); } } return result; } return 0; }
<<<<<<< apiException = JsonUtil.fromJson(errorString, ApiException.class); } catch (Exception ex) { ======= apiException = JsonUtil.getInstance().fromJson(errorString, ApiException.class); } catch (final Exception ex) { >>>>>>> apiException = JsonUtil.fromJson(errorString, ApiException.class); } catch (final Exception ex) {