function checkIfDatasetsAreProcessed($dataMatcherLinkOnePartFrom, $dataMatcherLinkOnePartTo) { $statusFrom = ExecutionManager::getExecutionStatusForOneTable($dataMatcherLinkOnePartFrom->sid, $dataMatcherLinkOnePartFrom->tableName); $statusTo = ExecutionManager::getExecutionStatusForOneTable($dataMatcherLinkOnePartTo->sid, $dataMatcherLinkOnePartTo->tableName); if ($statusFrom->status == "error" || $statusTo->status == "error") { die("datasets are in error"); } if ($statusFrom->status == "end" && $statusTo->status == "end") { return true; } return false; }
/** * Calculated data matching ratios for all links in a relationship specified by rel_id. The computation is done in a background. * While computing the ratios distinct values from stories involved in the relationship might be cached in MSSQL server. The caching happens only if two stories are form * different locations (e.g. different DBMS and server). * * @param [type] $rel_ids colfusion relationship id for which to calculate links data matching rations. * @return [type] [description] */ public function calculateDataMatchingRatios($rel_ids) { //var_dump($rel_ids); if (!isset($rel_ids) || count($rel_ids) == 0) { return; } $relationshipDAO = new RelationshipDAO(); foreach ($rel_ids as $key => $rel_id) { $rel = $relationshipDAO->getRelationship($rel_id); //this might too expensive, I don't need all infor about relationships, just sids, tablemes and links foreach ($rel->links as $key => $link) { $from = new DataMatcherLinkOnePart(); $from->sid = $rel->fromDataset->sid; $from->tableName = $rel->fromTableName; $from->transformation = $link->fromPartEncoded; $to = new DataMatcherLinkOnePart(); $to->sid = $rel->toDataset->sid; $to->tableName = $rel->toTableName; $to->transformation = $link->toPartEncoded; //var_dump($from, $to); ExecutionManager::callChildProcessToCacheDistinctColumnValues($from, $to); } } }
public static function callChildProcessToCacheDistinctColumnValues(DataMatcherLinkOnePart $dataMatcherLinkOnePartFrom, DataMatcherLinkOnePart $dataMatcherLinkOnePartTo) { $script_url = my_pligg_base . '/dataMatchChecker/execute_cachingDistinctColumnValues_parallel.php'; $vars = array("dataMatcherLinkOnePartFrom" => serialize($dataMatcherLinkOnePartFrom), 'dataMatcherLinkOnePartTo' => serialize($dataMatcherLinkOnePartTo)); ExecutionManager::callChildProcess($script_url, $vars); }
function getDatasetStatus($sid) { return ExecutionManager::getExecutionStatus($sid); }
<?php include_once '../config.php'; include_once mnminclude . 'user.php'; require_once realpath(dirname(__FILE__)) . "/ExecutionManager.php"; require_once realpath(dirname(__FILE__)) . "/KTRManager.php"; // parent sript, called by user request from browser $sid = getSid(); global $current_user, $db; $author = $current_user->user_id; $ktrManagers = unserialize($_SESSION["ktrArguments_{$sid}"]["ktrManagers"]); foreach ($ktrManagers as $filename => $ktrManager) { ExecutionManager::callChildProcessToExectueOneKTRTransformation($sid, $author, $ktrManager); } // TODO: read output from the child process if it was started successfully. $result = new stdClass(); $result->isSuccessful = true; $result->message = 'Success!'; // $result->pentaho_cmd = $commands; echo json_encode($result); exit; function getSid() { // determine which step of the submit process we are on if (isset($_POST["sid"])) { $sid = $_POST["sid"]; } else { if (isset($_GET["sid"])) { $sid = $_GET["sid"]; } else { echo json_encode("no sid");
<?php // TODO: Delete this //error_reporting(E_ALL); //ini_set('display_errors', '1'); require_once 'config/settings.php'; $finder = new DBFinder(); $manager = new ExecutionManager($finder); $manager->run();
/** * Returns status of the story by sid. Excepts sid in POST * * Takes status value from execinfo table and put it together with relevant information */ function GetStoryStatus() { $sid = $_POST["sid"]; $result = ExecutionManager::getExecutionStatus($sid); echo json_encode($result); }
function Execute($sid, DatabaseHandler $dbHandler, $userId) { $inputData = $_POST; try { $queryEngine = new QueryEngine(); $queryEngine->simpleQuery->addSourceDBInfo($sid, $dbHandler->getHost(), $dbHandler->getPort(), $dbHandler->getUser(), $dbHandler->getPassword(), $dbHandler->getDatabase(), $dbHandler->getDriver(), $dbHandler->getIsImpoted(), $dbHandler->getLinkedServerName()); UtilsForWizard::processDataMatchingUserInputsStoreDB($sid, $inputData["dataMatchingUserInputs"]); $queryEngine->simpleQuery->setSourceTypeBySid($sid, 'database'); $resultJson = new stdClass(); $resultJson->isSuccessful = true; $resultJson->message = 'Success!'; echo json_encode($resultJson); // If a dump file is uploaded, start importing data in the background. if (isset($_SESSION["dump_file_{$sid}"])) { ExecutionManager::callChildProcessToImportDumpFile($sid, $userId, $dbHandler, $_SESSION["dump_file_{$sid}"]); } unset($_SESSION["dump_file_{$sid}"]); } catch (Exception $e) { $resultJson = new stdClass(); $resultJson->isSuccessful = false; $resultJson->message = $e->getMessage(); echo json_encode($resultJson); } }