示例#1
0
        printf("What is the page muliplier exponent of the array? The disk requests will be (2 ^ pmultExp) * %d bytes\n", MMAP_PAGE_SIZE);
        cin >> meta.pageMultExp;
        FATALIF(meta.pageMultExp > 8, "Now, now, is that not excessive?");

        std::random_device rd;
        std::mt19937_64 rand_gen(rd());
        meta.arrayHash = rand_gen(); // random arrayHash
        meta.stripeParam1 = rand_gen();
        meta.stripeParam2 = rand_gen();
        meta.numberOfPages = 0;

        <?php 
grokit\sql_statements_norez(<<<'EOT'
"
          INSERT INTO DiskArrays(name, arrayID, arrayHash, pageMultExp, stripeParam1, stripeParam2, numberOfPages)
          VALUES ('Default', %ld, %ld, %ld, %ld, %ld, %ld);
"
EOT
, ['meta.arrayID', 'meta.arrayHash', 'meta.pageMultExp', 'meta.stripeParam1', 'meta.stripeParam2', 'meta.numberOfPages']);
?>
;

        printf("The disk array can use multiple stripes. How many stripes should we use?\n");
        cin >> meta.HDNo;
        FATALIF( meta.HDNo<1 || meta.HDNo > 1000, "The number of disks is unacceptable");

        printf("Pattern for the stripes fies. Use %%d for the position of the numbers. The numbering starts at 1\n");
        string pattern;
        cin >> pattern;

        <?php 
示例#2
0
;

<?php 
grokit\sql_statements_norez(<<<'EOT'
"
        DELETE FROM CatalogAttributes;
        "
EOT
, []);
?>
;

<?php 
grokit\sql_statements_norez(<<<'EOT'
"
  DELETE FROM CatalogClusters;
"
EOT
, []);
?>
;

    schemas.MoveToStart();
    int _relID = 0;
    while (schemas.RightLength()) {
        Schema& sch = schemas.Current();
        string relName = sch.GetRelationName();
        int numTup = sch.GetNumTuples();
        AttributeContainer attCont;
        sch.GetAttributes(attCont);
        Attribute clusterAtt;
        bool clustered = sch.GetClusterAttribute(clusterAtt);
示例#3
0
"
          INSERT INTO Relations(relID, arrayID, relName, numColumns, freeChunkID)
        VALUES (%d, %d, '%s', %d, 0);
      "
EOT
, ['relID', 'arrayID', 'relName', 'numCols']);
?>
;
    }

    // update the freeChunkID of the relation
<?php 
grokit\sql_statements_norez(<<<'EOT'
"
        UPDATE Relations SET freeChunkID=%ld
        WHERE relName='%s';
"
EOT
, ['(unsigned long)numChunks', 'relName']);
?>
;

    DeleteContentSQL(relID, <?php 
echo grokit\sql_database_object();
?>
);

    // Now flush all chunk info first
<?php 
grokit\sql_statement_parametric_norez(<<<'EOT'
"
示例#4
0
    orderValid = true;
}

void Dictionary::Save(const char* name){
    if (!modified)
        return;

<?php 
grokit\sql_open_database('GetMetadataDB() ');
?>
;

<?php 
grokit\sql_statements_norez(<<<'EOT'
"
DELETE FROM "Dictionary_%s";
"
EOT
, ['name']);
?>
;

<?php 
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
void DiskMemoryAllocator::Load(sqlite3* db) {
    pthread_mutex_lock(&mutex);
<?php 
grokit\sql_existing_database('db');
?>
;

<?php 
grokit\sql_statements_norez(<<<'EOT'
"
        CREATE TABLE IF NOT EXISTS DiskAllocatorState (
            arrayID        INTEGER,
          relID          INTEGER,
          startPage      INTEGER,
            size           INTEGER,
          nextFreePage   INTEGER,
          lastPage       INTEGER
        );
  "
EOT
, []);
?>
;

<?php 
grokit\sql_statement_table(<<<'EOT'
"
      SELECT relID, startPage, size, nextFreePage, lastPage
      FROM DiskAllocatorState
      WHERE arrayID=%d;