Impala
Impalaistheopensource,nativeanalyticdatabaseforApacheHadoop.
Main Page
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
disk-io-mgr-stress-test.cc
Go to the documentation of this file.
1
// Copyright 2012 Cloudera Inc.
2
//
3
// Licensed under the Apache License, Version 2.0 (the "License");
4
// you may not use this file except in compliance with the License.
5
// You may obtain a copy of the License at
6
//
7
// http://www.apache.org/licenses/LICENSE-2.0
8
//
9
// Unless required by applicable law or agreed to in writing, software
10
// distributed under the License is distributed on an "AS IS" BASIS,
11
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
// See the License for the specific language governing permissions and
13
// limitations under the License.
14
15
#include "
runtime/disk-io-mgr-stress.h
"
16
#include "
util/cpu-info.h
"
17
#include "
util/string-parser.h
"
18
19
#include "
common/names.h
"
20
21
using namespace
impala;
22
23
// Simple utility to run the disk io stress test. A optional second parameter
24
// can be passed to control how long to run this test (0 for forever).
25
26
// TODO: make these configurable once we decide how to run BE tests with args
27
const
int
DEFAULT_DURATION_SEC
= 1;
28
const
int
NUM_DISKS
= 5;
29
const
int
NUM_THREADS_PER_DISK
= 5;
30
const
int
NUM_CLIENTS
= 10;
31
const
bool
TEST_CANCELLATION
=
true
;
32
33
int
main
(
int
argc,
char
** argv) {
34
google::InitGoogleLogging(argv[0]);
35
CpuInfo::Init
();
36
impala::InitThreading
();
37
int
duration_sec =
DEFAULT_DURATION_SEC
;
38
39
if
(argc == 2) {
40
StringParser::ParseResult
status;
41
duration_sec = StringParser::StringToInt<int>(argv[1], strlen(argv[1]), &status);
42
if
(status !=
StringParser::PARSE_SUCCESS
) {
43
printf(
"Invalid arg: %s\n"
, argv[1]);
44
return
1;
45
}
46
}
47
if
(duration_sec != 0) {
48
printf(
"Running stress test for %d seconds.\n"
, duration_sec);
49
}
else
{
50
printf(
"Running stress test indefinitely.\n"
);
51
}
52
DiskIoMgrStress
test(
NUM_DISKS
,
NUM_THREADS_PER_DISK
,
NUM_CLIENTS
,
TEST_CANCELLATION
);
53
test.
Run
(duration_sec);
54
55
return
0;
56
}
NUM_THREADS_PER_DISK
const int NUM_THREADS_PER_DISK
Definition:
disk-io-mgr-stress-test.cc:29
main
int main(int argc, char **argv)
Definition:
disk-io-mgr-stress-test.cc:33
impala::StringParser::PARSE_SUCCESS
Definition:
string-parser.h:52
impala::DiskIoMgrStress
Definition:
disk-io-mgr-stress.h:36
string-parser.h
impala::InitThreading
void InitThreading()
Initialises the threading subsystem. Must be called before a Thread is created.
Definition:
thread.cc:261
impala::StringParser::ParseResult
ParseResult
Definition:
string-parser.h:51
disk-io-mgr-stress.h
DEFAULT_DURATION_SEC
const int DEFAULT_DURATION_SEC
Definition:
disk-io-mgr-stress-test.cc:27
names.h
impala::CpuInfo::Init
static void Init()
Initialize CpuInfo.
Definition:
cpu-info.cc:75
impala::DiskIoMgrStress::Run
void Run(int sec)
Run the test for 'sec'. If 0, run forever.
Definition:
disk-io-mgr-stress.cc:174
TEST_CANCELLATION
const bool TEST_CANCELLATION
Definition:
disk-io-mgr-stress-test.cc:31
NUM_CLIENTS
const int NUM_CLIENTS
Definition:
disk-io-mgr-stress-test.cc:30
cpu-info.h
NUM_DISKS
const int NUM_DISKS
Definition:
disk-io-mgr-stress-test.cc:28
be
src
runtime
disk-io-mgr-stress-test.cc
Generated on Thu May 7 2015 16:10:36 for Impala by
1.8.6