Exemplo n.º 1
0
        <?php 
grokit\sql_statement_parametric_norez(<<<'EOT'
"
          INSERT INTO Stripes(diskID, arrayID, fileName) VALUES (?1, ?2, ?3);
          "
EOT
, ['int', 'int', 'text'], []);
?>
;
        for (uint64_t i=0; i<meta.HDNo; i++){
            char fileName[1000];
            sprintf(fileName, pattern.c_str(), i+1);
	    HDThread::CreateStripe(fileName, meta.arrayHash, i, MMAP_PAGE_SIZE << meta.pageMultExp);

            <?php 
grokit\sql_instantiate_parameters(['i', 'meta.arrayID', 'fileName']);
?>
;
        }
        <?php 
grokit\sql_parametric_end();
?>
;

    } else { // disk array is valid
#if 0
        printf("Opening Disk Array %ld: pageMultExp:%ld,\tnumberOfPages=%ld\n", meta.arrayID, meta.pageMultExp, meta.numberOfPages);
#endif
        // get the number of drives
        <?php 
grokit\sql_statement_scalar(<<<'EOT'
Exemplo n.º 2
0
    if( clustered ) {
<?php 
grokit\sql_statement_parametric_norez(<<<'EOT'
"
  INSERT INTO CatalogClusters(relID, attID)
  VALUES (?1, ?2)
"
EOT
, ['int', 'int']);
?>

    int _attId = clusterAtt.GetIndex();

<?php 
grokit\sql_instantiate_parameters(['_relID', '_attId']);
?>

<?php 
grokit\sql_parametric_end();
?>
    }

    schemas.Advance();
    }
<?php 
grokit\sql_close_database();
?>
;

  cout << "Catalog saved " << endl;
Exemplo n.º 3
0
    // Now flush all fragment info for each column
<?php 
grokit\sql_statement_parametric_norez(<<<'EOT'
"
            INSERT INTO Fragment(relID, chunkID, colNo, endPos) VALUES (?1, ?2, ?3, ?4);
            "
EOT
, ['int', 'int', 'int', 'int'], []);
?>
;
            for (uint64_t chunkit = 0; chunkit < chunkMetaD.size(); chunkit++) {
                for (uint64_t colit = 0; colit < chunkMetaD[chunkit].colMetaData.size(); colit++) {
                    // iterate through ranges
                    for (uint64_t i = 0; i < chunkMetaD[chunkit].colMetaData[colit].fragments.startPositions.size(); i++) {
<?php 
grokit\sql_instantiate_parameters(['relID', 'chunkit', 'colit', 'chunkMetaD[chunkit].colMetaData[colit].fragments.startPositions[i]']);
?>
;
                    }
                }
            }
<?php 
grokit\sql_parametric_end();
?>
;

    // now ask the diskArray to flush as well
    DiskArray& diskArray = DiskArray::GetDiskArray();
    diskArray.Flush(<?php 
echo grokit\sql_database_object();
?>
Exemplo n.º 4
0
grokit\sql_statement_parametric_norez(<<<'EOT'
"
    INSERT INTO "Dictionary_%s" ("id", "order", "str") VALUES (?1, ?2, ?3);
"
EOT
, ['int', 'int', 'text'], ['name']);
?>
;
    // iterate through the dictionary
    for( IndexMap::const_iterator it = indexMap.begin(); it != indexMap.end(); ++it ) {
        IntType id = it->first;
        StringType s = it->second;
        IntType order = orderMap[id];
        const char * str = s.c_str();
<?php 
grokit\sql_instantiate_parameters(['id', 'order', 'str']);
?>
;
    }
<?php 
grokit\sql_parametric_end();
?>
;

<?php 
grokit\sql_close_database();
?>
;

  modified = false;
}
Exemplo n.º 5
0
                uint64_t n = (l->listOfChunks)[i]->nextFreePage;
                //printf("startPg = %d, sz = %d, n = %d, rel = %d, diskArrayID = %d, lastPage = %d\n", startPg, sz, n, rel, mDiskArrayID, mLastPage);
<?php 
grokit\sql_instantiate_parameters(['mDiskArrayID', 'rel', 'startPg', 'sz', 'n', 'mLastPage']);
?>
;
            }
    }
        for (list<ChunkInfo*>::iterator iter = mFreeChunks.begin(); iter != mFreeChunks.end(); ++iter) {
            uint64_t rel = -1;
            uint64_t startPg = (*iter)->startPage;
            uint64_t sz = (*iter)->size;
            uint64_t n = (*iter)->nextFreePage;
            //printf("-1 startPg = %d, sz = %d, n = %d, rel = %d, diskArrayID = %d, lastPage = %d\n", startPg, sz, n, rel, mDiskArrayID, mLastPage);
<?php 
grokit\sql_instantiate_parameters(['mDiskArrayID', 'rel', 'startPg', 'sz', 'n', 'mLastPage']);
?>
;
        }
<?php 
grokit\sql_parametric_end();
?>
;
    pthread_mutex_unlock(&mutex);
}

void DiskMemoryAllocator::Load(sqlite3* db) {
    pthread_mutex_lock(&mutex);
<?php 
grokit\sql_existing_database('db');
?>