File tree Expand file tree Collapse file tree 4 files changed +37
-28
lines changed
applications/harbormaster/storage Expand file tree Collapse file tree 4 files changed +37
-28
lines changed Original file line number Diff line number Diff line change 10441044 'HarbormasterBuildGraph' => 'applications/harbormaster/engine/HarbormasterBuildGraph.php',
10451045 'HarbormasterBuildLintMessage' => 'applications/harbormaster/storage/build/HarbormasterBuildLintMessage.php',
10461046 'HarbormasterBuildLog' => 'applications/harbormaster/storage/build/HarbormasterBuildLog.php',
1047+ 'HarbormasterBuildLogChunk' => 'applications/harbormaster/storage/build/HarbormasterBuildLogChunk.php',
10471048 'HarbormasterBuildLogPHIDType' => 'applications/harbormaster/phid/HarbormasterBuildLogPHIDType.php',
10481049 'HarbormasterBuildLogQuery' => 'applications/harbormaster/query/HarbormasterBuildLogQuery.php',
10491050 'HarbormasterBuildMessage' => 'applications/harbormaster/storage/HarbormasterBuildMessage.php',
51915192 'HarbormasterDAO',
51925193 'PhabricatorPolicyInterface',
51935194 ),
5195+ 'HarbormasterBuildLogChunk' => 'HarbormasterDAO',
51945196 'HarbormasterBuildLogPHIDType' => 'PhabricatorPHIDType',
51955197 'HarbormasterBuildLogQuery' => 'PhabricatorCursorPagedPolicyAwareQuery',
51965198 'HarbormasterBuildMessage' => array(
Original file line number Diff line number Diff line change @@ -21,31 +21,6 @@ public function buildSchemata() {
2121 ),
2222 ));
2323
24-
25- $ this ->buildRawSchema (
26- id (new HarbormasterBuildable ())->getApplicationName (),
27- HarbormasterBuildLog::CHUNK_TABLE ,
28- array (
29- 'id ' => 'auto ' ,
30- 'logID ' => 'id ' ,
31- 'encoding ' => 'text32 ' ,
32-
33- // T6203/NULLABILITY
34- // Both the type and nullability of this column are crazily wrong.
35- 'size ' => 'uint32? ' ,
36-
37- 'chunk ' => 'bytes ' ,
38- ),
39- array (
40- 'PRIMARY ' => array (
41- 'columns ' => array ('id ' ),
42- 'unique ' => true ,
43- ),
44- 'key_log ' => array (
45- 'columns ' => array ('logID ' ),
46- ),
47- ));
48-
4924 }
5025
5126}
Original file line number Diff line number Diff line change @@ -15,7 +15,6 @@ final class HarbormasterBuildLog
1515 private $ isOpen ;
1616
1717 const CHUNK_BYTE_LIMIT = 102400 ;
18- const CHUNK_TABLE = 'harbormaster_buildlogchunk ' ;
1918
2019 /**
2120 * The log is encoded as plain text.
@@ -128,7 +127,7 @@ private function flush() {
128127 // caller writes a single character over and over again, we'll currently
129128 // spend a lot of time flushing that.
130129
131- $ chunk_table = self :: CHUNK_TABLE ;
130+ $ chunk_table = id ( new HarbormasterBuildLogChunk ())-> getTableName () ;
132131 $ chunk_limit = self ::CHUNK_BYTE_LIMIT ;
133132 $ rope = $ this ->rope ;
134133
@@ -198,9 +197,10 @@ public function getLogText() {
198197 $ result = queryfx_all (
199198 $ conn ,
200199 'SELECT chunk ' .
201- 'FROM harbormaster_buildlogchunk ' .
200+ 'FROM %T ' .
202201 'WHERE logID = %d ' .
203202 'ORDER BY id ASC ' ,
203+ id (new HarbormasterBuildLogChunk ())->getTableName (),
204204 $ this ->getID ());
205205
206206 $ content = '' ;
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ final class HarbormasterBuildLogChunk
4+ extends HarbormasterDAO {
5+
6+ protected $ logID ;
7+ protected $ encoding ;
8+ protected $ size ;
9+ protected $ chunk ;
10+
11+ protected function getConfiguration () {
12+ return array (
13+ self ::CONFIG_TIMESTAMPS => false ,
14+ self ::CONFIG_COLUMN_SCHEMA => array (
15+ 'logID ' => 'id ' ,
16+ 'encoding ' => 'text32 ' ,
17+
18+ // T6203/NULLABILITY
19+ // Both the type and nullability of this column are crazily wrong.
20+ 'size ' => 'uint32? ' ,
21+
22+ 'chunk ' => 'bytes ' ,
23+ ),
24+ self ::CONFIG_KEY_SCHEMA => array (
25+ 'key_log ' => array (
26+ 'columns ' => array ('logID ' ),
27+ ),
28+ ),
29+ ) + parent ::getConfiguration ();
30+ }
31+
32+ }
You can’t perform that action at this time.
0 commit comments