13
13
*/
14
14
package com .facebook .presto .testing .mysql ;
15
15
16
- import com .google .common .base .VerifyException ;
17
16
import com .google .common .collect .ImmutableList ;
18
17
19
18
import java .io .IOException ;
20
- import java .util .Arrays ;
21
19
import java .util .List ;
22
20
23
21
final class EmbeddedMySql5
@@ -32,48 +30,54 @@ public EmbeddedMySql5(MySqlOptions mySqlOptions)
32
30
@ Override
33
31
public List <String > getInitializationArguments ()
34
32
{
35
- List <String > list = Arrays .asList (
36
- "--no-defaults" ,
37
- "--skip-sync-frm" ,
38
- "--innodb-flush-method=nosync" ,
39
- "--datadir=" + getDataDirectory ());
33
+ ImmutableList .Builder <String > iList = ImmutableList .<String >builder ()
34
+ .add (
35
+ "--no-defaults" ,
36
+ "--skip-sync-frm" ,
37
+ "--innodb-flush-method=nosync" ,
38
+ "--datadir=" + getDataDirectory ());
40
39
41
40
if (isMariadb ) {
42
- return ImmutableList .< String > builder (). addAll ( list ) .add ("--basedir=" + getBaseDirectory ()).build ();
41
+ return iList .add ("--basedir=" + getBaseDirectory ()).build ();
43
42
}
44
43
else {
45
- return ImmutableList .< String > builder (). addAll ( list ) .add ("--initialize-insecure" ).build ();
44
+ return iList .add ("--initialize-insecure" ).build ();
46
45
}
47
46
}
48
47
49
48
@ Override
50
- public List <String > getStartArguments () throws VerifyException
49
+ public List <String > getStartArguments ()
51
50
{
52
- List <String > list = Arrays .asList (
53
- "--no-defaults" ,
54
- "--default-time-zone=+00:00" ,
55
- "--skip-sync-frm" ,
56
- "--innodb-flush-method=nosync" ,
57
- "--innodb-flush-log-at-trx-commit=0" ,
58
- "--innodb-doublewrite=0" ,
59
- "--bind-address=localhost" ,
60
- "--port=" + String .valueOf (getPort ()),
61
- "--datadir=" + getDataDirectory (),
62
- "--socket=" + getSocketDirectory ());
51
+ ImmutableList .Builder <String > iList = ImmutableList .<String >builder ()
52
+ .add (
53
+ "--no-defaults" ,
54
+ "--default-time-zone=+00:00" ,
55
+ "--skip-sync-frm" ,
56
+ "--innodb-flush-method=nosync" ,
57
+ "--innodb-flush-log-at-trx-commit=0" ,
58
+ "--innodb-doublewrite=0" ,
59
+ "--bind-address=localhost" ,
60
+ "--port=" + String .valueOf (getPort ()),
61
+ "--datadir=" + getDataDirectory (),
62
+ "--socket=" + getSocketDirectory ());
63
63
64
64
if (isMariadb ) {
65
- return ImmutableList .<String >builder ().addAll (list ).add (
66
- "--basedir=" + getBaseDirectory (),
67
- "--plugin-dir=" + getMariadbPluginDirectory (),
68
- "--log-error=" + getDataDirectory () + "mariadb.log" ,
69
- "--pid-file=" + getDataDirectory () + "mariadb.pid" ).build ();
65
+ return iList
66
+ .add (
67
+ "--basedir=" + getBaseDirectory (),
68
+ "--plugin-dir=" + getMariadbPluginDirectory (),
69
+ "--log-error=" + getDataDirectory () + "mariadb.log" ,
70
+ "--pid-file=" + getDataDirectory () + "mariadb.pid" )
71
+ .build ();
70
72
}
71
73
else {
72
- return ImmutableList .<String >builder ().addAll (list ).add (
73
- "--skip-ssl" ,
74
- "--disable-partition-engine-check" ,
75
- "--explicit_defaults_for_timestamp" ,
76
- "--lc_messages_dir=" + getShareDirectory ()).build ();
74
+ return iList
75
+ .add (
76
+ "--skip-ssl" ,
77
+ "--disable-partition-engine-check" ,
78
+ "--explicit_defaults_for_timestamp" ,
79
+ "--lc_messages_dir=" + getShareDirectory ())
80
+ .build ();
77
81
}
78
82
}
79
83
}
0 commit comments