author | phh |
Sat, 30 Nov 2019 14:33:05 -0800 | |
changeset 59330 | 5b96c12f909d |
parent 59226 | a0f39cc47387 |
permissions | -rw-r--r-- |
50113 | 1 |
/* |
53244
9807daeb47c4
8216167: Update include guards to reflect correct directories
coleenp
parents:
50113
diff
changeset
|
2 |
* Copyright (c) 2012, 2019, Oracle and/or its affiliates. All rights reserved. |
50113 | 3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
* |
|
5 |
* This code is free software; you can redistribute it and/or modify it |
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
|
7 |
* published by the Free Software Foundation. |
|
8 |
* |
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
13 |
* accompanied this code). |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License version |
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
18 |
* |
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
|
20 |
* or visit www.oracle.com if you need additional information or have any |
|
21 |
* questions. |
|
22 |
* |
|
23 |
*/ |
|
24 |
||
53244
9807daeb47c4
8216167: Update include guards to reflect correct directories
coleenp
parents:
50113
diff
changeset
|
25 |
#ifndef SHARE_JFR_RECORDER_REPOSITORY_JFRCHUNKWRITER_HPP |
9807daeb47c4
8216167: Update include guards to reflect correct directories
coleenp
parents:
50113
diff
changeset
|
26 |
#define SHARE_JFR_RECORDER_REPOSITORY_JFRCHUNKWRITER_HPP |
50113 | 27 |
|
28 |
#include "jfr/writers/jfrStorageAdapter.hpp" |
|
29 |
#include "jfr/writers/jfrStreamWriterHost.inline.hpp" |
|
30 |
#include "jfr/writers/jfrWriterHost.inline.hpp" |
|
31 |
||
58863 | 32 |
typedef MallocAdapter<M> JfrChunkBuffer; // 1 mb buffered writes |
33 |
typedef StreamWriterHost<JfrChunkBuffer, JfrCHeapObj> JfrBufferedChunkWriter; |
|
34 |
typedef WriterHost<BigEndianEncoder, CompressedIntegerEncoder, JfrBufferedChunkWriter> JfrChunkWriterBase; |
|
50113 | 35 |
|
58863 | 36 |
class JfrChunk; |
37 |
class JfrChunkHeadWriter; |
|
50113 | 38 |
|
39 |
class JfrChunkWriter : public JfrChunkWriterBase { |
|
58863 | 40 |
friend class JfrChunkHeadWriter; |
50113 | 41 |
friend class JfrRepository; |
42 |
private: |
|
58863 | 43 |
JfrChunk* _chunk; |
44 |
void set_path(const char* path); |
|
45 |
int64_t flush_chunk(bool flushpoint); |
|
50113 | 46 |
bool open(); |
58863 | 47 |
int64_t close(); |
48 |
int64_t current_chunk_start_nanos() const; |
|
49 |
int64_t write_chunk_header_checkpoint(bool flushpoint); |
|
50113 | 50 |
|
51 |
public: |
|
52 |
JfrChunkWriter(); |
|
58863 | 53 |
~JfrChunkWriter(); |
54 |
||
53897
0abec72a3ac2
8217647: JFR: recordings on 32-bit systems unreadable
bulasevich
parents:
53244
diff
changeset
|
55 |
int64_t size_written() const; |
58132
caa25ab47aca
8225797: OldObjectSample event creates unexpected amount of checkpoint data
mgronlun
parents:
53897
diff
changeset
|
56 |
int64_t last_checkpoint_offset() const; |
caa25ab47aca
8225797: OldObjectSample event creates unexpected amount of checkpoint data
mgronlun
parents:
53897
diff
changeset
|
57 |
void set_last_checkpoint_offset(int64_t offset); |
58863 | 58 |
void set_last_metadata_offset(int64_t offset); |
59 |
||
60 |
bool has_metadata() const; |
|
61 |
void set_time_stamp(); |
|
59226 | 62 |
void mark_chunk_final(); |
50113 | 63 |
}; |
64 |
||
53244
9807daeb47c4
8216167: Update include guards to reflect correct directories
coleenp
parents:
50113
diff
changeset
|
65 |
#endif // SHARE_JFR_RECORDER_REPOSITORY_JFRCHUNKWRITER_HPP |