Page MenuHomePhabricator

D15376.id.diff
No OneTemporary

D15376.id.diff

diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php
--- a/src/__phutil_library_map__.php
+++ b/src/__phutil_library_map__.php
@@ -1044,6 +1044,7 @@
'HarbormasterBuildGraph' => 'applications/harbormaster/engine/HarbormasterBuildGraph.php',
'HarbormasterBuildLintMessage' => 'applications/harbormaster/storage/build/HarbormasterBuildLintMessage.php',
'HarbormasterBuildLog' => 'applications/harbormaster/storage/build/HarbormasterBuildLog.php',
+ 'HarbormasterBuildLogChunk' => 'applications/harbormaster/storage/build/HarbormasterBuildLogChunk.php',
'HarbormasterBuildLogPHIDType' => 'applications/harbormaster/phid/HarbormasterBuildLogPHIDType.php',
'HarbormasterBuildLogQuery' => 'applications/harbormaster/query/HarbormasterBuildLogQuery.php',
'HarbormasterBuildMessage' => 'applications/harbormaster/storage/HarbormasterBuildMessage.php',
@@ -5191,6 +5192,7 @@
'HarbormasterDAO',
'PhabricatorPolicyInterface',
),
+ 'HarbormasterBuildLogChunk' => 'HarbormasterDAO',
'HarbormasterBuildLogPHIDType' => 'PhabricatorPHIDType',
'HarbormasterBuildLogQuery' => 'PhabricatorCursorPagedPolicyAwareQuery',
'HarbormasterBuildMessage' => array(
diff --git a/src/applications/harbormaster/storage/HarbormasterSchemaSpec.php b/src/applications/harbormaster/storage/HarbormasterSchemaSpec.php
--- a/src/applications/harbormaster/storage/HarbormasterSchemaSpec.php
+++ b/src/applications/harbormaster/storage/HarbormasterSchemaSpec.php
@@ -21,31 +21,6 @@
),
));
-
- $this->buildRawSchema(
- id(new HarbormasterBuildable())->getApplicationName(),
- HarbormasterBuildLog::CHUNK_TABLE,
- array(
- 'id' => 'auto',
- 'logID' => 'id',
- 'encoding' => 'text32',
-
- // T6203/NULLABILITY
- // Both the type and nullability of this column are crazily wrong.
- 'size' => 'uint32?',
-
- 'chunk' => 'bytes',
- ),
- array(
- 'PRIMARY' => array(
- 'columns' => array('id'),
- 'unique' => true,
- ),
- 'key_log' => array(
- 'columns' => array('logID'),
- ),
- ));
-
}
}
diff --git a/src/applications/harbormaster/storage/build/HarbormasterBuildLog.php b/src/applications/harbormaster/storage/build/HarbormasterBuildLog.php
--- a/src/applications/harbormaster/storage/build/HarbormasterBuildLog.php
+++ b/src/applications/harbormaster/storage/build/HarbormasterBuildLog.php
@@ -15,7 +15,6 @@
private $isOpen;
const CHUNK_BYTE_LIMIT = 102400;
- const CHUNK_TABLE = 'harbormaster_buildlogchunk';
/**
* The log is encoded as plain text.
@@ -128,7 +127,7 @@
// caller writes a single character over and over again, we'll currently
// spend a lot of time flushing that.
- $chunk_table = self::CHUNK_TABLE;
+ $chunk_table = id(new HarbormasterBuildLogChunk())->getTableName();
$chunk_limit = self::CHUNK_BYTE_LIMIT;
$rope = $this->rope;
@@ -198,9 +197,10 @@
$result = queryfx_all(
$conn,
'SELECT chunk '.
- 'FROM harbormaster_buildlogchunk '.
+ 'FROM %T '.
'WHERE logID = %d '.
'ORDER BY id ASC',
+ id(new HarbormasterBuildLogChunk())->getTableName(),
$this->getID());
$content = '';
diff --git a/src/applications/harbormaster/storage/build/HarbormasterBuildLogChunk.php b/src/applications/harbormaster/storage/build/HarbormasterBuildLogChunk.php
new file mode 100644
--- /dev/null
+++ b/src/applications/harbormaster/storage/build/HarbormasterBuildLogChunk.php
@@ -0,0 +1,32 @@
+<?php
+
+final class HarbormasterBuildLogChunk
+ extends HarbormasterDAO {
+
+ protected $logID;
+ protected $encoding;
+ protected $size;
+ protected $chunk;
+
+ protected function getConfiguration() {
+ return array(
+ self::CONFIG_TIMESTAMPS => false,
+ self::CONFIG_COLUMN_SCHEMA => array(
+ 'logID' => 'id',
+ 'encoding' => 'text32',
+
+ // T6203/NULLABILITY
+ // Both the type and nullability of this column are crazily wrong.
+ 'size' => 'uint32?',
+
+ 'chunk' => 'bytes',
+ ),
+ self::CONFIG_KEY_SCHEMA => array(
+ 'key_log' => array(
+ 'columns' => array('logID'),
+ ),
+ ),
+ ) + parent::getConfiguration();
+ }
+
+}

File Metadata

Mime Type
text/plain
Expires
Mon, Oct 28, 12:30 PM (3 w, 12 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6737194
Default Alt Text
D15376.id.diff (4 KB)

Event Timeline