Skip to content

Commit 76b8604

Browse files
committed
feat: support jetty-servlet
1 parent 903f8d1 commit 76b8604

18 files changed

+2287
-18
lines changed

core/add_project.sh

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,15 @@ function setup_alluxio() {
4848
mvn clean install -DskipTests -Dcheckstyle.skip -Dlicense.skip -Dfindbugs.skip -Dmaven.javadoc.skip=true
4949
}
5050

51+
function setup_jetty() {
52+
[ ! -d "app/ctest-jetty" ] && git clone https://github.com/Moonlor/ctest-jetty.git app/ctest-jetty
53+
cd app/ctest-jetty
54+
home_dir=$PWD
55+
git fetch && git checkout ctest-injection
56+
cd $home_dir/jetty-servlet
57+
mvn clean install -DskipTests
58+
}
59+
5160
function usage() {
5261
echo "Usage: add_project.sh <main project>"
5362
exit 1
@@ -64,7 +73,8 @@ function main() {
6473
hbase) setup_hbase ;;
6574
zookeeper) setup_zookeeper ;;
6675
alluxio) setup_alluxio ;;
67-
*) echo "Unexpected project: $project - only support hadoop, hbase, zookeeper and alluxio." ;;
76+
jetty) setup_jetty;;
77+
*) echo "Unexpected project: $project - only support hadoop, hbase, zookeeper, alluxio and jetty." ;;
6878
esac
6979
fi
7080
}

core/ctest_const.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,21 @@
1212
HBASE = "hbase-server"
1313
ZOOKEEPER = "zookeeper-server"
1414
ALLUXIO = "alluxio-core"
15+
JTSERVLET = "jetty-servlet"
1516

1617
CTEST_HADOOP_DIR = os.path.join(APP_DIR, "ctest-hadoop")
1718
CTEST_HBASE_DIR = os.path.join(APP_DIR, "ctest-hbase")
1819
CTEST_ZK_DIR = os.path.join(APP_DIR, "ctest-zookeeper")
1920
CTEST_ALLUXIO_DIR = os.path.join(APP_DIR, "ctest-alluxio")
21+
CTEST_JTSERVLET_DIR = os.path.join(APP_DIR, "ctest-jetty")
2022

2123
PROJECT_DIR = {
2224
HCOMMON: CTEST_HADOOP_DIR,
2325
HDFS: CTEST_HADOOP_DIR,
2426
HBASE: CTEST_HBASE_DIR,
2527
ZOOKEEPER: CTEST_ZK_DIR,
2628
ALLUXIO: CTEST_ALLUXIO_DIR,
29+
JTSERVLET: CTEST_JTSERVLET_DIR,
2730
}
2831

2932

@@ -34,6 +37,7 @@
3437
HBASE: "hbase-server",
3538
ZOOKEEPER: "zookeeper-server",
3639
ALLUXIO: "core",
40+
JTSERVLET: "jetty-servlet",
3741
}
3842

3943

@@ -58,6 +62,9 @@
5862
os.path.join(CTEST_ALLUXIO_DIR, MODULE_SUBDIR[ALLUXIO], "server/worker", SUREFIRE_SUBDIR),
5963
os.path.join(CTEST_ALLUXIO_DIR, MODULE_SUBDIR[ALLUXIO], "server/master", SUREFIRE_SUBDIR),
6064
],
65+
"jetty-servlet": [
66+
os.path.join(CTEST_JTSERVLET_DIR, MODULE_SUBDIR[JTSERVLET], SUREFIRE_SUBDIR)
67+
]
6168
}
6269

6370
# default or deprecate conf path
@@ -74,7 +81,8 @@
7481
HDFS: os.path.join(DEFAULT_CONF_DIR, HDFS + "-default.tsv"),
7582
HBASE: os.path.join(DEFAULT_CONF_DIR, HBASE + "-default.tsv"),
7683
ALLUXIO: os.path.join(DEFAULT_CONF_DIR, ALLUXIO + "-default.tsv"),
77-
ZOOKEEPER: os.path.join(DEFAULT_CONF_DIR, ZOOKEEPER + "-default.tsv")
84+
ZOOKEEPER: os.path.join(DEFAULT_CONF_DIR, ZOOKEEPER + "-default.tsv"),
85+
JTSERVLET: os.path.join(DEFAULT_CONF_DIR, JTSERVLET + "-default.tsv"),
7886
}
7987

8088

@@ -96,6 +104,9 @@
96104
],
97105
ALLUXIO: [
98106
os.path.join(CTEST_ALLUXIO_DIR, "core/alluxio-ctest.properties")
107+
],
108+
JTSERVLET: [
109+
os.path.join(CTEST_JTSERVLET_DIR, "jetty-servlet/target/classes/ctest.xml")
99110
]
100111
}
101112

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
FORCE_WRAPPER
2+
acceptRanges true If true, range requests and responses are supported.
3+
cacheControl max-age=3600,public If set, all static content will have this value set as the cache-control header.
4+
dirAllowed true If true, directory listings are returned if no welcome file is found. Else 403 Forbidden.
5+
dispatchPath
6+
encodingHeaderCacheSize 0 Max entries in a cache of ACCEPT-ENCODING headers.
7+
etags false If True, weak etags will be generated and handled.
8+
gzip true If set to true, then static content will be served as gzip content encoded if a matching resource is found ending with ".gz"
9+
maxCacheSize 256000000 The maximum total size of the cache or 0 for no cache.
10+
maxCachedFileSize 200000000 The maximum size of a file to cache
11+
maxCachedFiles 2048 maxCachedFiles
12+
nonContextServlets
13+
otherGzipFileExtensions
14+
pathInfoOnly false If true, only the path info will be applied to the resourceBase
15+
precompressed
16+
redirectWelcome false If true, welcome files are redirected rather than forwarded to.
17+
relativeResourceBase Set with a pathname relative to the base of the servlet context root. Useful for only serving static content out of only specific subdirectories.
18+
resourceBase Set to replace the context resource base
19+
resourceCache resourceCache If set, this is a context attribute name, which the servlet will use to look for a shared ResourceCache instance.
20+
restrictToLocalhost
21+
stylesheet Set with the location of an optional stylesheet that will be used to decorate the directory listing html.
22+
useFileMappedBuffer true If set to true, it will use mapped file buffers to serve static content when using an NIO connector. Setting this value to false means that a direct buffer will be used instead of a mapped file buffer. This file sets the value to true.
23+
welcomeServlets false If true, attempt to dispatch to welcome files that are servlets, but only after no matching static resources could be found. If false, then a welcome file must exist on disk. If "exact", then exact servlet matches are supported without an existing file. Default is true. This must be false if you want directory listings, but have index.jsp in your welcome file list.

core/generate_ctest/inject.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def inject_config(param_value_pairs):
2121
for p, v in param_value_pairs.items():
2222
file.write(p + "=" + v + "\n")
2323
file.close()
24-
elif project in [HCOMMON, HDFS, HBASE]:
24+
elif project in [HCOMMON, HDFS, HBASE, JTSERVLET]:
2525
conf = ET.Element("configuration")
2626
for p, v in param_value_pairs.items():
2727
prop = ET.SubElement(conf, "property")
@@ -46,7 +46,7 @@ def clean_conf_file(project):
4646
file = open(inject_path, "w")
4747
file.write("\n")
4848
file.close()
49-
elif project in [HCOMMON, HDFS, HBASE]:
49+
elif project in [HCOMMON, HDFS, HBASE, JTSERVLET]:
5050
conf = ET.Element("configuration")
5151
for inject_path in INJECTION_PATH[project]:
5252
file = open(inject_path, "wb")

core/generate_ctest/program_input.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
# run mode
55
"run_mode": "generate_ctest", # string
66
# name of the project, i.e. hadoop-common, hadoop-hdfs, see constant.py
7-
"project": "hadoop-common", # string
7+
"project": "jetty-servlet", # string
88
# path to param -> tests json mapping
9-
"mapping_path": "../../data/ctest_mapping/opensource-hadoop-common.json", # string
9+
"mapping_path": "../../data/ctest_mapping/opensource-jetty-servlet.json", # string
1010
# good values of params tests will be run against
11-
"param_value_tsv": "sample-hadoop-common.tsv", # string
11+
"param_value_tsv": "sample-jetty-servlet.tsv", # string
1212
# display the terminal output live, without saving any results
1313
"display_mode": False, # bool
1414
# whether to use mvn test or mvn surefire:test
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
FORCE_WRAPPER SKIP SKIP
2+
acceptRanges false SKIP
3+
cacheControl max-age=3600 public
4+
dirAllowed false SKIP
5+
dispatchPath SKIP SKIP
6+
encodingHeaderCacheSize 1 -1
7+
etags true SKIP
8+
gzip false SKIP
9+
maxCacheSize 128000000 512000000
10+
maxCachedFileSize 100000000 400000000
11+
maxCachedFiles 1024 4096
12+
nonContextServlets SKIP SKIP
13+
otherGzipFileExtensions SKIP SKIP
14+
pathInfoOnly true SKIP
15+
precompressed SKIP SKIP
16+
redirectWelcome true SKIP
17+
relativeResourceBase SKIP SKIP
18+
resourceBase SKIP SKIP
19+
resourceCache SKIP SKIP
20+
restrictToLocalhost SKIP SKIP
21+
stylesheet SKIP SKIP
22+
useFileMappedBuffer false SKIP
23+
welcomeServlets true SKIP

core/generate_value/value_generation.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ def read_tsv(module):
2525
if module == "zookeeper-server":
2626
assert len(params) == 32
2727
return 32
28+
elif module == "jetty-servlet":
29+
assert len(params) == 23
30+
return 23
2831
else:
2932
assert len(params) == 90
3033
return 90
@@ -105,6 +108,8 @@ def print_params(module):
105108
f = open(module + output, "w")
106109
if module == "zookeeper-server":
107110
assert len(params) == 32
111+
elif module == "jetty-servlet":
112+
assert len(params) == 23
108113
else:
109114
assert len(params) >= 90
110115
for param in params:

core/identify_param/add_project.sh

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,15 @@ function setup_alluxio() {
4747
mvn clean install -DskipTests -Dcheckstyle.skip -Dlicense.skip -Dfindbugs.skip -Dmaven.javadoc.skip=true
4848
}
4949

50+
function setup_jetty() {
51+
[ ! -d "app/ctest-jetty" ] && git clone https://github.com/Moonlor/ctest-jetty.git app/ctest-jetty
52+
cd app/ctest-jetty
53+
home_dir=$PWD
54+
git fetch && git checkout ctest-logging
55+
cd $home_dir/jetty-servlet
56+
mvn clean install -DskipTests
57+
}
58+
5059
function usage() {
5160
echo "Usage: add_project.sh <main project>"
5261
exit 1
@@ -63,7 +72,8 @@ function main() {
6372
hbase) setup_hbase ;;
6473
zookeeper) setup_zookeeper ;;
6574
alluxio) setup_alluxio ;;
66-
*) echo "Unexpected project: $project - only support hadoop, hbase, zookeeper and alluxio." ;;
75+
jetty) setup_jetty;;
76+
*) echo "Unexpected project: $project - only support hadoop, hbase, zookeeper, alluxio and jetty." ;;
6777
esac
6878
fi
6979
}

core/identify_param/constant.py

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,23 @@
77
CTEST_HBASE_DIR = os.path.join(APP_DIR, "ctest-hbase")
88
CTEST_ZOOKEEPER_DIR = os.path.join(APP_DIR, "ctest-zookeeper")
99
CTEST_ALLUXIO_DIR = os.path.join(APP_DIR, "ctest-alluxio")
10+
CTEST_JETTY_DIR = os.path.join(APP_DIR, "ctest-jetty")
1011

1112
MODULE_PATH = {
1213
"hadoop-common": CTEST_HADOOP_DIR,
1314
"hadoop-hdfs": CTEST_HADOOP_DIR,
1415
"hbase-server": CTEST_HBASE_DIR,
15-
"alluxio-core": CTEST_ALLUXIO_DIR
16+
"alluxio-core": CTEST_ALLUXIO_DIR,
17+
"jetty-servlet": CTEST_JETTY_DIR,
1618
}
1719

1820
SRC_SUBDIR = {
1921
"hadoop-common": "hadoop-common-project/hadoop-common",
2022
"hadoop-hdfs": "hadoop-hdfs-project/hadoop-hdfs",
2123
"hbase-server": "hbase-server",
2224
"zookeeper-server": "zookeeper-server",
23-
"alluxio-core": "core"
25+
"alluxio-core": "core",
26+
"jetty-servlet": "jetty-servlet",
2427
}
2528

2629
MVN_TEST_PATH = {
@@ -29,14 +32,16 @@
2932
"hbase-server": os.path.join(CTEST_HBASE_DIR, SRC_SUBDIR["hbase-server"]),
3033
"zookeeper-server": os.path.join(CTEST_ZOOKEEPER_DIR, SRC_SUBDIR["zookeeper-server"]),
3134
"alluxio-core": os.path.join(CTEST_ALLUXIO_DIR, SRC_SUBDIR["alluxio-core"]),
35+
"jetty-servlet": os.path.join(CTEST_JETTY_DIR, SRC_SUBDIR["jetty-servlet"])
3236
}
3337

3438
LOCAL_CONF_PATH = {
3539
"hadoop-common": "results/hadoop-common/conf_params.txt",
3640
"hadoop-hdfs": "results/hadoop-hdfs/conf_params.txt",
3741
"hbase-server": "results/hbase-server/conf_params.txt",
3842
"zookeeper-server": "results/zookeeper-server/conf_params.txt",
39-
"alluxio-core": "results/alluxio-core/conf_params.txt"
43+
"alluxio-core": "results/alluxio-core/conf_params.txt",
44+
"jetty-servlet": "results/jetty-servlet/conf_params.txt"
4045
}
4146

4247
SUREFIRE_SUBDIR = "target/surefire-reports/*"
@@ -63,7 +68,10 @@
6368
os.path.join(CTEST_ALLUXIO_DIR, "core/server/proxy", SUREFIRE_SUBDIR),
6469
os.path.join(CTEST_ALLUXIO_DIR, "core/server/worker", SUREFIRE_SUBDIR),
6570
os.path.join(CTEST_ALLUXIO_DIR, "core/server/master", SUREFIRE_SUBDIR)
66-
]
71+
],
72+
"jetty-servlet": [
73+
os.path.join(CTEST_JETTY_DIR, SRC_SUBDIR["jetty-servlet"], SUREFIRE_SUBDIR)
74+
],
6775
}
6876

6977
LOCAL_SUREFIRE_SUFFIX = "surefire-reports/*"
@@ -83,5 +91,8 @@
8391
],
8492
"alluxio-core": [
8593
os.path.join("surefire-reports/alluxio-core", LOCAL_SUREFIRE_SUFFIX)
86-
]
94+
],
95+
"jetty-servlet": [
96+
os.path.join("surefire-reports/jetty-servlet", LOCAL_SUREFIRE_SUFFIX)
97+
],
8798
}

core/identify_param/identify_param.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ function main() {
1212
usage
1313
else
1414
case $project in
15-
hadoop-common | hadoop-hdfs | hbase-server | zookeeper-server | alluxio-core) python3 runner.py $project; python3 collector.py $project ;;
15+
hadoop-common | hadoop-hdfs | hbase-server | zookeeper-server | alluxio-core | jetty-servlet) python3 runner.py $project; python3 collector.py $project ;;
1616
-h | --help) usage ;;
17-
*) echo "Unexpected project: $project - only support hadoop-common, hadoop-hdfs, hbase-server, zookeeper-server and alluxio-core." ;;
17+
*) echo "Unexpected project: $project - only support hadoop-common, hadoop-hdfs, hbase-server, zookeeper-server, alluxio-core and jetty-servlet." ;;
1818
esac
1919
fi
2020
}

0 commit comments

Comments
 (0)