src/jdk.jfr/share/classes/jdk/jfr/internal/MetadataDescriptor.java
changeset 58863 c16ac7a2eba4
parent 50113 caf115bb98ad
equal deleted inserted replaced
58861:2c3cc4b01880 58863:c16ac7a2eba4
     1 /*
     1 /*
     2  * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     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
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Oracle designates this
     7  * published by the Free Software Foundation.  Oracle designates this
    23  * questions.
    23  * questions.
    24  */
    24  */
    25 
    25 
    26 package jdk.jfr.internal;
    26 package jdk.jfr.internal;
    27 
    27 
    28 import java.io.DataInput;
       
    29 import java.io.DataOutput;
    28 import java.io.DataOutput;
    30 import java.io.IOException;
    29 import java.io.IOException;
    31 import java.util.ArrayList;
    30 import java.util.ArrayList;
    32 import java.util.Collection;
    31 import java.util.Collection;
    33 import java.util.List;
    32 import java.util.List;
    34 import java.util.Locale;
    33 import java.util.Locale;
    35 import java.util.TimeZone;
    34 import java.util.TimeZone;
    36 
    35 
    37 import jdk.jfr.EventType;
    36 import jdk.jfr.EventType;
       
    37 import jdk.jfr.internal.consumer.RecordingInput;
    38 
    38 
    39 /**
    39 /**
    40  * Metadata about a chunk
    40  * Metadata about a chunk
    41  */
    41  */
    42 public final class MetadataDescriptor {
    42 public final class MetadataDescriptor {
   212     final List<EventType> eventTypes = new ArrayList<>();
   212     final List<EventType> eventTypes = new ArrayList<>();
   213     final Collection<Type> types = new ArrayList<>();
   213     final Collection<Type> types = new ArrayList<>();
   214     long gmtOffset;
   214     long gmtOffset;
   215     String locale;
   215     String locale;
   216     Element root;
   216     Element root;
       
   217     public long metadataId;
   217 
   218 
   218     // package private
   219     // package private
   219     MetadataDescriptor() {
   220     MetadataDescriptor() {
   220     }
   221     }
   221 
   222 
   250 
   251 
   251     public String getLocale() {
   252     public String getLocale() {
   252         return locale;
   253         return locale;
   253     }
   254     }
   254 
   255 
   255     public static MetadataDescriptor read(DataInput input) throws IOException {
   256     public static MetadataDescriptor read(RecordingInput input) throws IOException {
   256         MetadataReader r = new MetadataReader(input);
   257         MetadataReader r = new MetadataReader(input);
   257         return r.getDescriptor();
   258         return r.getDescriptor();
   258     }
   259     }
   259 
   260 
   260     static void write(List<Type> types, DataOutput output) throws IOException {
   261     static void write(List<Type> types, DataOutput output) throws IOException {