{
        return preferences.getBoolean("debug_pixel_ratio_enabled", DEFAULT_PIXEL_RATIO_ENABLED);
    }

package com.jakewharton.u2020.data;

import android.app.Application;
import android.content.SharedPreferences;
import com.f2prateek.rx.preferences.Preference;
import com.f2prateek.rx.preferences.RxSharedPreferences;
import com.jakewharton.picasso.OkHttp3Downloader;
import com.jakewharton.u2020.IsInstrumentationTest;
import com.jakewharton.u2020.data.api.DebugApiModule;
import com.jakewharton.u2020.data.api.oauth.AccessToken;
import com.jakewharton.u2020.data.prefs.InetSocketAddressPreferenceAdapter;
import com.jakewharton.u2020.intentfactory.CapturingIntentFactory;
import com.jakewharton.u2020.intentfactory.IntentFactory;
import com.squareup.picasso.Picasso;
import dagger.Module;
import dagger.Provides;
import java.net.InetSocketAddress;
import java.security.cert.CertificateException;
import java.security.cert.X509Certificate;
import javax.inject.Singleton;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLSocketFactory;
import javax.net.ssl.TrustManager;
import javax.net.ssl.X509TrustManager;
import okhttp3.OkHttpClient;
import retrofit2.mock.NetworkBehavior;
import timber.log.Timber;

@Module(includes = DebugApiModule.class, complete = false, library = true, overrides = true)
public final class DebugDataModule {

    private static final int DEFAULT_ANIMATION_SPEED = 1;

    // Debug indicators displayed
    private static final boolean DEFAULT_PICASSO_DEBUGGING = false;

    // No pixel grid overlay.
    private static final boolean DEFAULT_PIXEL_GRID_ENABLED = false;

    // No pixel ratio overlay.
    private static final boolean DEFAULT_PIXEL_RATIO_ENABLED = false;

    // No crazy 3D view tree.
    private static final boolean DEFAULT_SCALPEL_ENABLED = false;

    // Draw views by default.
    private static final boolean DEFAULT_SCALPEL_WIREFRAME_ENABLED = false;

    // Show debug drawer first time.
    private static final boolean DEFAULT_SEEN_DEBUG_DRAWER = false;

    // Capture external intents.
    private static final boolean DEFAULT_CAPTURE_INTENTS = true;

    @Provides
    @Singleton
    RxSharedPreferences provideRxSharedPreferences(SharedPreferences prefs) {
        return RxSharedPreferences.create(prefs);
    }

    @Provides
    @Singleton
    IntentFactory provideIntentFactory(@IsMockMode boolean isMockMode, @CaptureIntents Preference<Boolean> captureIntents) {
        return new CapturingIntentFactory(IntentFactory.REAL, () -> isMockMode && captureIntents.get());
    }

    @Provides
    @Singleton
    OkHttpClient provideOkHttpClient(Application app, Preference<InetSocketAddress> networkProxyAddress) {
        return DataModule.createOkHttpClient(app).sslSocketFactory(createBadSslSocketFactory()).proxy(InetSocketAddressPreferenceAdapter.createProxy(networkProxyAddress.get())).build();
    }

    @Provides
    @Singleton
    @AccessToken
    Preference<String> provideAccessToken(RxSharedPreferences prefs, @ApiEndpoint Preference<String> endpoint) {
        // Return an endpoint-specific preference.
        return prefs.getString("access-token-" + endpoint.get());
    }

    @Provides
    @Singleton
    @ApiEndpoint
    Preference<String> provideEndpointPreference(RxSharedPreferences preferences) {
        return preferences.getString("debug_endpoint", ApiEndpoints.MOCK_MODE.url);
    }

    @Provides
    @Singleton
    @IsMockMode
    boolean provideIsMockMode(@ApiEndpoint Preference<String> endpoint, @IsInstrumentationTest boolean isInstrumentationTest) {
        // Running in an instrumentation forces mock mode.
        return isInstrumentationTest || ApiEndpoints.isMockMode(endpoint.get());
    }

    @Provides
    @Singleton
    @NetworkDelay
    Preference<Long> provideNetworkDelay(RxSharedPreferences preferences) {
        return preferences.getLong("debug_network_delay", 2000l);
    }

    @Provides
    @Singleton
    @NetworkFailurePercent
    Preference<Integer> provideNetworkFailurePercent(RxSharedPreferences preferences) {
        return preferences.getInteger("debug_network_failure_percent", 3);
    }

    @Provides
    @Singleton
    @NetworkErrorPercent
    Preference<Integer> provideNetworkErrorPercent(RxSharedPreferences preferences) {
        return preferences.getInteger("debug_network_error_percent", 0);
    }

    @Provides
    @Singleton
    Preference<NetworkErrorCode> provideNetworkErrorCode(RxSharedPreferences preferences) {
        return preferences.getEnum("debug_network_error_code", NetworkErrorCode.HTTP_500, NetworkErrorCode.class);
    }

    @Provides
    @Singleton
    @NetworkVariancePercent
    Preference<Integer> provideNetworkVariancePercent(RxSharedPreferences preferences) {
        return preferences.getInteger("debug_network_variance_percent", 40);
    }

    @Provides
    @Singleton
    Preference<InetSocketAddress> provideNetworkProxyAddress(RxSharedPreferences preferences) {
        return preferences.getObject("debug_network_proxy", InetSocketAddressPreferenceAdapter.INSTANCE);
    }

    @Provides
    @Singleton
    @CaptureIntents
    Preference<Boolean> provideCaptureIntentsPreference(RxSharedPreferences preferences) {
        return preferences.getBoolean("debug_capture_intents", DEFAULT_CAPTURE_INTENTS);
    }

    @Provides
    @Singleton
    @AnimationSpeed
    Preference<Integer> provideAnimationSpeed(RxSharedPreferences preferences) {
        return preferences.getInteger("debug_animation_speed", DEFAULT_ANIMATION_SPEED);
    }

    @Provides
    @Singleton
    @PicassoDebugging
    Preference<Boolean> providePicassoDebugging(RxSharedPreferences preferences) {
        return preferences.getBoolean("debug_picasso_debugging", DEFAULT_PICASSO_DEBUGGING);
    }

    @Provides
    @Singleton
    @PixelGridEnabled
    Preference<Boolean> providePixelGridEnabled(RxSharedPreferences preferences) {
        return preferences.getBoolean("debug_pixel_grid_enabled", DEFAULT_PIXEL_GRID_ENABLED);
    }

    @Provides
    @Singleton
    @PixelRatioEnabled
    Preference<Boolean> providePixelRatioEnabled(RxSharedPreferences preferences)

    @Provides
    @Singleton
    @SeenDebugDrawer
    Preference<Boolean> provideSeenDebugDrawer(RxSharedPreferences preferences) {
        return preferences.getBoolean("debug_seen_debug_drawer", DEFAULT_SEEN_DEBUG_DRAWER);
    }

    @Provides
    @Singleton
    @ScalpelEnabled
    Preference<Boolean> provideScalpelEnabled(RxSharedPreferences preferences) {
        return preferences.getBoolean("debug_scalpel_enabled", DEFAULT_SCALPEL_ENABLED);
    }

    @Provides
    @Singleton
    @ScalpelWireframeEnabled
    Preference<Boolean> provideScalpelWireframeEnabled(RxSharedPreferences preferences) {
        return preferences.getBoolean("debug_scalpel_wireframe_drawer", DEFAULT_SCALPEL_WIREFRAME_ENABLED);
    }

    @Provides
    @Singleton
    Picasso providePicasso(OkHttpClient client, NetworkBehavior behavior, @IsMockMode boolean isMockMode, Application app) {
        Picasso.Builder builder = new Picasso.Builder(app).downloader(new OkHttp3Downloader(client));
        if (isMockMode) {
            builder.addRequestHandler(new MockRequestHandler(behavior, app.getAssets()));
        }
        builder.listener((picasso, uri, exception) -> {
            Timber.e(exception, "Error while loading image %s", uri);
        });
        return builder.build();
    }

    private static SSLSocketFactory createBadSslSocketFactory() {
        try {
            // Construct SSLSocketFactory that accepts any cert.
            SSLContext context = SSLContext.getInstance("TLS");
            TrustManager permissive = new X509TrustManager() {

                @Override
                public void checkClientTrusted(X509Certificate[] chain, String authType) throws CertificateException {
                }

                @Override
                public void checkServerTrusted(X509Certificate[] chain, String authType) throws CertificateException {
                }

                @Override
                public X509Certificate[] getAcceptedIssuers() {
                    return new X509Certificate[0];
                }
            };
            context.init(null, new TrustManager[] { permissive }, null);
            return context.getSocketFactory();
        } catch (Exception e) {
            throw new AssertionError(e);
        }
    }
}


package com.jakewharton.u2020.data;

import android.app.Application;
import android.content.SharedPreferences;
import com.f2prateek.rx.preferences.Preference;
import com.f2prateek.rx.preferences.RxSharedPreferences;
import com.jakewharton.picasso.OkHttp3Downloader;
import com.jakewharton.u2020.IsInstrumentationTest;
import com.jakewharton.u2020.data.api.DebugApiModule;
import com.jakewharton.u2020.data.api.oauth.AccessToken;
import com.jakewharton.u2020.data.prefs.InetSocketAddressPreferenceAdapter;
import com.jakewharton.u2020.intentfactory.CapturingIntentFactory;
import com.jakewharton.u2020.intentfactory.IntentFactory;
import com.squareup.picasso.Picasso;
import dagger.Module;
import dagger.Provides;
import java.net.InetSocketAddress;
import java.security.cert.CertificateException;
import java.security.cert.X509Certificate;
import javax.inject.Singleton;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLSocketFactory;
import javax.net.ssl.TrustManager;
import javax.net.ssl.X509TrustManager;
import okhttp3.OkHttpClient;
import retrofit2.mock.NetworkBehavior;
import timber.log.Timber;

@Module(includes = DebugApiModule.class, complete = false, library = true, overrides = true)
public final class DebugDataModule {

    private static final int DEFAULT_ANIMATION_SPEED = 1;

    // Debug indicators displayed
    private static final boolean DEFAULT_PICASSO_DEBUGGING = false;

    // No pixel grid overlay.
    private static final boolean DEFAULT_PIXEL_GRID_ENABLED = false;

    // No pixel ratio overlay.
    private static final boolean DEFAULT_PIXEL_RATIO_ENABLED = false;

    // No crazy 3D view tree.
    private static final boolean DEFAULT_SCALPEL_ENABLED = false;

    // Draw views by default.
    private static final boolean DEFAULT_SCALPEL_WIREFRAME_ENABLED = false;

    // Show debug drawer first time.
    private static final boolean DEFAULT_SEEN_DEBUG_DRAWER = false;

    // Capture external intents.
    private static final boolean DEFAULT_CAPTURE_INTENTS = true;

    @Provides
    @Singleton
    RxSharedPreferences provideRxSharedPreferences(SharedPreferences prefs) {
        return RxSharedPreferences.create(prefs);
    }

    @Provides
    @Singleton
    IntentFactory provideIntentFactory(@IsMockMode boolean isMockMode, @CaptureIntents Preference<Boolean> captureIntents) {
        return new CapturingIntentFactory(IntentFactory.REAL, () -> isMockMode && captureInten

    }

    @Provides
    @Singleton
    OkHttpClient provideOkHttpClient(Application app, Preference<InetSocketAddress> networkProxyAddress) {
        return DataModule.createOkHttpClient(app).sslSocketFactory(createBadSslSocketFactory()).proxy(InetSocketAddressPreferenceAdapter.createProxy(networkProxyAddress.get())).build();
    }

    @Provides
    @Singleton
    @AccessToken
    Preference<String> provideAccessToken(RxSharedPreferences prefs, @ApiEndpoint Preference<String> endpoint) {
        // Return an endpoint-specific preference.
        return prefs.getString("access-token-" + endpoint.get());
    }

    @Provides
    @Singleton
    @ApiEndpoint
    Preference<String> provideEndpointPreference(RxSharedPreferences preferences) {
        return preferences.getString("debug_endpoint", ApiEndpoints.MOCK_MODE.url);
    }

    @Provides
    @Singleton
    @IsMockMode
    boolean provideIsMockMode(@ApiEndpoint Preference<String> endpoint, @IsInstrumentationTest boolean isInstrumentationTest) {
        // Running in an instrumentation forces mock mode.
        return isInstrumentationTest || ApiEndpoints.isMockMode(endpoint.get());
    }

    @Provides
    @Singleton
    @NetworkDelay
    Preference<Long> provideNetworkDelay(RxSharedPreferences preferences) {
        return preferences.getLong("debug_network_delay", 2000l);
    }

    @Provides
    @Singleton
    @NetworkFailurePercent
    Preference<Integer> provideNetworkFailurePercent(RxSharedPreferences preferences) {
        return preferences.getInteger("debug_network_failure_percent", 3);
    }

    @Provides
    @Singleton
    @NetworkErrorPercent
    Preference<Integer> provideNetworkErrorPercent(RxSharedPreferences preferences) {
        return preferences.getInteger("debug_network_error_percent", 0);
    }

    @Provides
    @Singleton
    Preference<NetworkErrorCode> provideNetworkErrorCode(RxSharedPreferences preferences) {
        return preferences.getEnum("debug_network_error_code", NetworkErrorCode.HTTP_500, NetworkErrorCode.class);
    }

    @Provides
    @Singleton
    @NetworkVariancePercent
    Preference<Integer> provideNetworkVariancePercent(RxSharedPreferences preferences) {
        return preferences.getInteger("debug_network_variance_percent", 40);
    }

    @Provides
    @Singleton
    Preference<InetSocketAddress> provideNetworkProxyAddress(RxSharedPreferences preferences) {
        return preferences.getObject("debug_network_proxy", InetSocketAddressPreferenceAdapter.INSTANCE);
    }

    @Provides
    @Singleton
    @CaptureIntents
    Preference<Boolean> provideCaptureIntentsPreference(RxSharedPreferences preferences) {
        return preferences.getBoolean("debug_capture_intents", DEFAULT_CAPTURE_INTENTS);
    }

    @Provides
    @Singleton
    @AnimationSpeed
    Preference<Integer> provideAnimationSpeed(RxSharedPreferences preferences) {
        return preferences.getInteger("debug_animation_speed", DEFAULT_ANIMATION_SPEED);
    }

    @Provides
    @Singleton
    @PicassoDebugging
    Preference<Boolean> providePicassoDebugging(RxSharedPreferences preferences) {
        return preferences.getBoolean("debug_picasso_debugging", DEFAULT_PICASSO_DEBUGGING);
    }

    @Provides
    @Singleton
    @PixelGridEnabled
    Preference<Boolean> providePixelGridEnabled(RxSharedPreferences preferences) {
        return preferences.getBoolean("debug_pixel_grid_enabled", DEFAULT_PIXEL_GRID_ENABLED);
    }

    @Provides
    @Singleton
    @PixelRatioEnabled
    Preference<Boolean> providePixelRatioEnabled(RxSharedPreferences preferences) {
        return preferences.getBoolean("debug_pixel_ratio_enabled", DEFAULT_PIXEL_RATIO_ENABLED);
    }

    @Provides
    @Singleton
    @SeenDebugDrawer
    Preference<Boolean> provideSeenDebugDrawer(RxSharedPreferences preferences) {
        return preferences.getBoolean("debug_seen_debug_drawer", DEFAULT_SEEN_DEBUG_DRAWER);
    }

    @Provides
    @Singleton
    @ScalpelEnabled
    Preference<Boolean> provideScalpelEnabled(RxSharedPreferences preferences) {
        return preferences.getBoolean("debug_scalpel_enabled", DEFAULT_SCALPEL_ENABLED);
    }

    @Provides
    @Singleton
    @ScalpelWireframeEnabled
    Preference<Boolean> provideScalpelWireframeEnabled(RxSharedPreferences preferences) {
        return preferences.getBoolean("debug_scalpel_wireframe_drawer", DEFAULT_SCALPEL_WIREFRAME_ENABLED);
    }

    @Provides
    @Singleton
    Picasso providePicasso(OkHttpClient client, NetworkBehavior behavior, @IsMockMode boolean isMockMode, Application app) {
        Picasso.Builder builder = new Picasso.Builder(app).downloader(new OkHttp3Downloader(client));
        if (isMockMode) {
            builder.addRequestHandler(new MockRequestHandler(behavior, app.getAssets()));
        }
        builder.listener((picasso, uri, exception) -> {
            Timber.e(exception, "Error while loading image %s", uri);
        });
        return builder.build();
    }

    private static SSLSocketFactory createBadSslSocketFactory() {
        try {
            // Construct SSLSocketFactory that accepts any cert.
            SSLContext context = SSLContext.getInstance("TLS");
            TrustManager permissive = new X509TrustManager() {

                @Override
                public void checkClientTrusted(X509Certificate[] chain, String authType) throws CertificateException {
                }

                @Override
                public void checkServerTrusted(X509Certificate[] chain, String authType) throws CertificateException {
                }

                @Override
                public X509Certificate[] getAcceptedIssuers() {
                    return new X509Certificate[0];
                }
            };
            context.init(null, new TrustManager[] { permissive }, null);
            return context.getSocketFactory();
        } catch (Exception e) {
            throw new AssertionError(e);
        }
    }
}


public HostRoleCommandStatusSummaryDTO failed(int count)

package org.apache.ambari.server.orm.dao;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.ambari.server.actionmanager.HostRoleStatus;

/**
 * Summary for a single stage with summary counts for the tasks for that stage.
 */
public class HostRoleCommandStatusSummaryDTO {

    private Long m_stageId = Long.valueOf(0L);

    private Long m_minTime = Long.valueOf(0L);

    private Long m_maxTime = Long.valueOf(Long.MAX_VALUE);

    private boolean m_skippable = false;

    private Map<HostRoleStatus, Integer> m_counts = new HashMap<>();

    private List<HostRoleStatus> m_tasksStatus = new ArrayList<>();

    /**
     * Constructor invoked by JPA.  See {{@link HostRoleCommandDAO#findAggregateCounts(Long)}}
     */
    public HostRoleCommandStatusSummaryDTO(Number skippable, Number minStartTime, Number maxEndTime, Number stageId, Number aborted, Number completed, Number failed, Number holding, Number holdingFailed, Number holdingTimedout, Number inProgress, Number pending, Number queued, Number timedout, Number skippedFailed) {
        m_stageId = Long.valueOf(null == stageId ? 0L : stageId.longValue());
        if (null != skippable) {
            m_skippable = (1 == skippable.intValue());
        }
        if (null != minStartTime) {
            m_minTime = Long.valueOf(minStartTime.longValue());
        }
        if (null != maxEndTime) {
            m_maxTime = Long.valueOf(maxEndTime.longValue());
        }
        put(HostRoleStatus.ABORTED, aborted);
        put(HostRoleStatus.COMPLETED, completed);
        put(HostRoleStatus.FAILED, failed);
        put(HostRoleStatus.HOLDING, holding);
        put(HostRoleStatus.HOLDING_FAILED, holdingFailed);
        put(HostRoleStatus.HOLDING_TIMEDOUT, holdingTimedout);
        put(HostRoleStatus.IN_PROGRESS, inProgress);
        put(HostRoleStatus.PENDING, pending);
        put(HostRoleStatus.QUEUED, queued);
        put(HostRoleStatus.TIMEDOUT, timedout);
        put(HostRoleStatus.SKIPPED_FAILED, skippedFailed);
    }

    @SuppressWarnings("boxing")
    private void put(HostRoleStatus status, Number number) {
        if (null != number) {
            m_counts.put(status, number.intValue());
            for (int i = 0; i < number.intValue(); i++) {
                m_tasksStatus.add(status);
            }
        } else {
            m_counts.put(status, 0);
        }
    }

    /**
     * @return the stage id for this summary
     */
    Long getStageId() {
        return m_stageId;
    }

    /**
     * @return the task result counts, by status
     */
    public Map<HostRoleStatus, Integer> getCounts() {
        return m_counts;
    }

    /**
     * @return the list of tasks status, expanded to cover all tasks for the stage
     */
    public List<HostRoleStatus> getTaskStatuses() {
        return m_tasksStatus;
    }

    /**
     * @return the total number of tasks for the stage
     */
    public int getTaskTotal() {
        return m_tasksStatus.size();
    }

    /**
     * @return {@code true} if the stage is skippable
     */
    public boolean isStageSkippable() {
        return m_skippable;
    }

    /**
     * @return the start time, minimum, for the tasks
     */
    public Long getStartTime() {
        return m_minTime;
    }

    /**
     * @return the end time, maximum, for the tasks
     */
    public Long getEndTime() {
        return m_maxTime;
    }

    /**
     * For testing, create an empty summary.
     */
    public static HostRoleCommandStatusSummaryDTO create() {
        return new HostRoleCommandStatusSummaryDTO(0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, // timedout
        0L, // skippedFailed
        0L);
    }

    /**
     * For testing, set the number of {@link HostRoleStatus#COMPLETED} tasks
     */
    public HostRoleCommandStatusSummaryDTO completed(int count) {
        put(HostRoleStatus.COMPLETED, Integer.valueOf(count));
        return this;
    }

    /**
     * For testing, set the number of {@link HostRoleStatus#FAILED} tasks
     */

{
        put(HostRoleStatus.FAILED, Integer.valueOf(count));
        return this;
    }

    /**
     * For testing, set the number of {@link HostRoleStatus#ABORTED} tasks
     */
    public HostRoleCommandStatusSummaryDTO aborted(int count) {
        put(HostRoleStatus.ABORTED, count);
        return this;
    }

    /**
     * For testing, set the number of {@link HostRoleStatus#TIMEDOUT} tasks
     */
    public HostRoleCommandStatusSummaryDTO timedout(int count) {
        put(HostRoleStatus.TIMEDOUT, count);
        return this;
    }

    /**
     * For testing, set the number of {@link HostRoleStatus#IN_PROGRESS} tasks
     */
    public HostRoleCommandStatusSummaryDTO inProgress(int count) {
        put(HostRoleStatus.IN_PROGRESS, count);
        return this;
    }

    /**
     * For testing, set the number of {@link HostRoleStatus#PENDING} tasks
     */
    public HostRoleCommandStatusSummaryDTO pending(int count) {
        put(HostRoleStatus.PENDING, count);
        return this;
    }

    /**
     * For testing, set the number of {@link HostRoleStatus#QUEUED} tasks
     */
    public HostRoleCommandStatusSummaryDTO queued(int count) {
        put(HostRoleStatus.QUEUED, count);
        return this;
    }

    /**
     * For testing, set the number of {@link HostRoleStatus#SKIPPED_FAILED} tasks
     */
    public HostRoleCommandStatusSummaryDTO skippedFailed(int count) {
        put(HostRoleStatus.SKIPPED_FAILED, count);
        return this;
    }
}


package org.apache.ambari.server.orm.dao;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.ambari.server.actionmanager.HostRoleStatus;

/**
 * Summary for a single stage with summary counts for the tasks for that stage.
 */
public class HostRoleCommandStatusSummaryDTO {

    private Long m_stageId = Long.valueOf(0L);

    private Long m_minTime = Long.valueOf(0L);

    private Long m_maxTime = Long.valueOf(Long.MAX_VALUE);

    private boolean m_skippable = false;

    private Map<HostRoleStatus, Integer> m_counts = new HashMap<>();

    private List<HostRoleStatus> m_tasksStatus = new ArrayList<>();

    /**
     * Constructor invoked by JPA.  See {{@link HostRoleCommandDAO#findAggregateCounts(Long)}}
     */
    public HostRoleCommandStatusSummaryDTO(Number skippable, Number minStartTime, Number maxEndTime, Number stageId, Number aborted, Number completed, Number failed, Number holding, Number holdingFailed, Number holdingTimedout, Number inProgress, Number pending, Number queued, Number timedout, Number skippedFailed) {
        m_stageId = Long.valueOf(null == stageId ? 0L : stageId.longValue());
        if (null != skippable) {
            m_skippable = (1 == skippable.intValue());
        }
        if (null != minStartTime) {
            m_minTime = Long.valueOf(minStartTime.longValue());
        }
        if (null != maxEndTime) {
            m_maxTime = Long.valueOf(maxEndTime.longValue());
        }
        put(HostRoleStatus.ABORTED, aborted);
        put(HostRoleStatus.COMPLETED, completed);
        put(HostRoleStatus.FAILED, failed);
        put(HostRoleStatus.HOLDING, holding);
        put(HostRoleStatus.HOLDING_FAILED, holdingFailed);
        put(HostRoleStatus.HOLDING_TIMEDOUT, holdingTimedout);
        put(HostRoleStatus.IN_PROGRESS, inProgress);
        put(HostRoleStatus.PENDING, pending);
        put(HostRoleStatus.QUEUED, queued);
        put(HostRoleStatus.TIMEDOUT, timedout);
        put(HostRoleStatus.SKIPPED_FAILED, skippedFailed);
    }

    @SuppressWarnings("boxing")
    private void put(HostRoleStatus status, Number number) {
        if (null != number) {
            m_counts.put(status, number.intValue());
            for (int i = 0; i < number.intValue(); i++) {
                m_tasksStatus.add(status);
            }
        } else {
            m_counts.put(status, 0);
        }
    }

    /**
     * @return the stage id for this summary
     */
    Long getStageId() {
        return m_stageId;
    }

    /**
     * @return the task result counts, by status
     */
    public Map<HostRoleStatus, Integer> getCounts() {
        return m_counts;
    }

    /**
     * @return the list of tasks status, expanded to cover all tasks for the stage
     */
    public List<HostRoleStatus> getTaskStatuses() {
        return m_tasksStatus;
    }

    /**
     * @return the total number of tasks for the stage
     */
    public int getTaskTotal() {
        return m_tasksStatus.size();
    }

    /**
     * @return {@code true} if the stage is skippable
     */
    public boolean isStageSkippable() {
        return m_skippable;
    }

    /**
     * @return the start time, minimum, for the tasks
     */
    public Long getStartTime() {
        return m_minTime;
    }

    /**
     * @return the end time, maximum, for the tasks
     */
    public Long getEndTime()

    /**
     * For testing, create an empty summary.
     */
    public static HostRoleCommandStatusSummaryDTO create() {
        return new HostRoleCommandStatusSummaryDTO(0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, // timedout
        0L, // skippedFailed
        0L);
    }

    /**
     * For testing, set the number of {@link HostRoleStatus#COMPLETED} tasks
     */
    public HostRoleCommandStatusSummaryDTO completed(int count) {
        put(HostRoleStatus.COMPLETED, Integer.valueOf(count));
        return this;
    }

    /**
     * For testing, set the number of {@link HostRoleStatus#FAILED} tasks
     */
    public HostRoleCommandStatusSummaryDTO failed(int count) {
        put(HostRoleStatus.FAILED, Integer.valueOf(count));
        return this;
    }

    /**
     * For testing, set the number of {@link HostRoleStatus#ABORTED} tasks
     */
    public HostRoleCommandStatusSummaryDTO aborted(int count) {
        put(HostRoleStatus.ABORTED, count);
        return this;
    }

    /**
     * For testing, set the number of {@link HostRoleStatus#TIMEDOUT} tasks
     */
    public HostRoleCommandStatusSummaryDTO timedout(int count) {
        put(HostRoleStatus.TIMEDOUT, count);
        return this;
    }

    /**
     * For testing, set the number of {@link HostRoleStatus#IN_PROGRESS} tasks
     */
    public HostRoleCommandStatusSummaryDTO inProgress(int count) {
        put(HostRoleStatus.IN_PROGRESS, count);
        return this;
    }

    /**
     * For testing, set the number of {@link HostRoleStatus#PENDING} tasks
     */
    public HostRoleCommandStatusSummaryDTO pending(int count) {
        put(HostRoleStatus.PENDING, count);
        return this;
    }

    /**
     * For testing, set the number of {@link HostRoleStatus#QUEUED} tasks
     */
    public HostRoleCommandStatusSummaryDTO queued(int count) {
        put(HostRoleStatus.QUEUED, count);
        return this;
    }

    /**
     * For testing, set the number of {@link HostRoleStatus#SKIPPED_FAILED} tasks
     */
    public HostRoleCommandStatusSummaryDTO skippedFailed(int count) {
        put(HostRoleStatus.SKIPPED_FAILED, count);
        return this;
    }
}


package org.apache.ambari.server.orm.dao;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.ambari.server.actionmanager.HostRoleStatus;

/**
 * Summary for a single stage with summary counts for the tasks for that stage.
 */
public class HostRoleCommandStatusSummaryDTO {

    private Long m_stageId = Long.valueOf(0L);

    private Long m_minTime = Long.valueOf(0L);

    private Long m_maxTime = Long.valueOf(Long.MAX_VALUE);

    private boolean m_skippable = false;

    private Map<HostRoleStatus, Integer> m_counts = new HashMap<>();

    private List<HostRoleStatus> m_tasksStatus = new ArrayList<>();

    /**
     * Constructor invoked by JPA.  See {{@link HostRoleCommandDAO#findAggregateCounts(Long)}}
     */
    public HostRoleCommandStatusSummaryDTO(Number skippable, Number minStartTime, Number maxEndTime, Number stageId, Number aborted, Number completed, Number failed, Number holding, Number holdingFailed, Number holdingTimedout, Number inProgress, Number pending, Number queued, Number timedout, Number skippedFailed) {
        m_stageId = Long.valueOf(null == stageId ? 0L : stageId.longValue());
        if (null != skippable) {
            m_skippable = (1 == skippable.intValue());
        }
        if (null != minStartTime) {
            m_minTime = Long.valueOf(minStartTime.longValue());
        }
        if (null != maxEndTime) {
            m_maxTime = Long.valueOf(maxEndTime.longValue());
        }
        put(HostRoleStatus.ABORTED, aborted);
        put(HostRoleStatus.COMPLETED, completed);
        put(HostRoleStatus.FAILED, failed);
        put(HostRoleStatus.HOLDING, holding);
        put(HostRoleStatus.HOLDING_FAILED, holdingFailed);
        put(HostRoleStatus.HOLDING_TIMEDOUT, holdingTimedout);
        put(HostRoleStatus.IN_PROGRESS, inProgress);
        put(HostRoleStatus.PENDING, pending);
        put(HostRoleStatus.QUEUED, queued);
        put(HostRoleStatus.TIMEDOUT, timedout);
        put(HostRoleStatus.SKIPPED_FAILED, skippedFailed);
    }

    @SuppressWarnings("boxing")
    private void put(HostRoleStatus status, Number number) {
        if (null != number) {
            m_counts.put(status, number.intValue());
            for (int i = 0; i < number.intValue(); i++) {
                m_tasksStatus.add(status);
            }
        } else {
            m_counts.put(status, 0);
        }
    }

    /**
     * @return the stage id for this summary
     */
    Long getStageId() {
        return m_stageId;
    }

    /**
     * @return the task result counts, by status
     */
    public Map<HostRoleStatus, Integer> getCounts() {
        return m_counts;
    }

    /**
     * @return the list of tasks status, expanded to cover all tasks for the stage
     */
    public List<HostRoleStatus> getTaskStatuses() {
        return m_tasksStatus;
    }

    /**
     * @return the total number of tasks for the stage
     */
    public int getTaskTotal() {
        return m_tasksStatus.size();
    }

    /**
     * @return {@code true} if the stage is skippable
     */
    public boolean isStageSkippable() {
        return m_skippable;
    }

    /**
     * @return the start time, minimum, for the tasks
     */
    public Long getStartTime() {
        return m_minTime;
    }

    /**
     * @return the end time, maximum, for the tasks
     */
    public Long getEndTime() {
        return m_maxTime;
    }

    /**
     * For testing, create an empty summary.
     */
    public static HostRoleCommandStatusSummaryDTO create() {
        return new HostRoleCommandStatusSummaryDTO(0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, // timedout
        0L, // skippedFailed
        0L);
    }

    /**
     * For testing, set the number of {@link HostRoleStatus#COMPLETED} tasks
     */
    public HostRoleCommandStatusSummaryDTO completed(int count) {
        put(HostRoleStatus.COMPLETED, Integer.valueOf(count));
        return this;
    }

    /**
     * For testing, set the number of {@link HostRoleStatus#FAILED} tasks
     */
    public HostRoleCommandStatusSummaryDTO failed(int count) {
        put(HostRoleStatus.FAILED, Integer.val

        return this;
    }

    /**
     * For testing, set the number of {@link HostRoleStatus#ABORTED} tasks
     */
    public HostRoleCommandStatusSummaryDTO aborted(int count) {
        put(HostRoleStatus.ABORTED, count);
        return this;
    }

    /**
     * For testing, set the number of {@link HostRoleStatus#TIMEDOUT} tasks
     */
    public HostRoleCommandStatusSummaryDTO timedout(int count) {
        put(HostRoleStatus.TIMEDOUT, count);
        return this;
    }

    /**
     * For testing, set the number of {@link HostRoleStatus#IN_PROGRESS} tasks
     */
    public HostRoleCommandStatusSummaryDTO inProgress(int count) {
        put(HostRoleStatus.IN_PROGRESS, count);
        return this;
    }

    /**
     * For testing, set the number of {@link HostRoleStatus#PENDING} tasks
     */
    public HostRoleCommandStatusSummaryDTO pending(int count) {
        put(HostRoleStatus.PENDING, count);
        return this;
    }

    /**
     * For testing, set the number of {@link HostRoleStatus#QUEUED} tasks
     */
    public HostRoleCommandStatusSummaryDTO queued(int count) {
        put(HostRoleStatus.QUEUED, count);
        return this;
    }

    /**
     * For testing, set the number of {@link HostRoleStatus#SKIPPED_FAILED} tasks
     */
    public HostRoleCommandStatusSummaryDTO skippedFailed(int count) {
        put(HostRoleStatus.SKIPPED_FAILED, count);
        return this;
    }
}


public HostRoleCommandStatusSummaryDTO timedout(int count) {
        put(HostRoleStatus.TIMEDOUT, count);
        return this;
    }

package org.apache.ambari.server.orm.dao;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.ambari.server.actionmanager.HostRoleStatus;

/**
 * Summary for a single stage with summary counts for the tasks for that stage.
 */
public class HostRoleCommandStatusSummaryDTO {

    private Long m_stageId = Long.valueOf(0L);

    private Long m_minTime = Long.valueOf(0L);

    private Long m_maxTime = Long.valueOf(Long.MAX_VALUE);

    private boolean m_skippable = false;

    private Map<HostRoleStatus, Integer> m_counts = new HashMap<>();

    private List<HostRoleStatus> m_tasksStatus = new ArrayList<>();

    /**
     * Constructor invoked by JPA.  See {{@link HostRoleCommandDAO#findAggregateCounts(Long)}}
     */
    public HostRoleCommandStatusSummaryDTO(Number skippable, Number minStartTime, Number maxEndTime, Number stageId, Number aborted, Number completed, Number failed, Number holding, Number holdingFailed, Number holdingTimedout, Number inProgress, Number pending, Number queued, Number timedout, Number skippedFailed) {
        m_stageId = Long.valueOf(null == stageId ? 0L : stageId.longValue());
        if (null != skippable) {
            m_skippable = (1 == skippable.intValue());
        }
        if (null != minStartTime) {
            m_minTime = Long.valueOf(minStartTime.longValue());
        }
        if (null != maxEndTime) {
            m_maxTime = Long.valueOf(maxEndTime.longValue());
        }
        put(HostRoleStatus.ABORTED, aborted);
        put(HostRoleStatus.COMPLETED, completed);
        put(HostRoleStatus.FAILED, failed);
        put(HostRoleStatus.HOLDING, holding);
        put(HostRoleStatus.HOLDING_FAILED, holdingFailed);
        put(HostRoleStatus.HOLDING_TIMEDOUT, holdingTimedout);
        put(HostRoleStatus.IN_PROGRESS, inProgress);
        put(HostRoleStatus.PENDING, pending);
        put(HostRoleStatus.QUEUED, queued);
        put(HostRoleStatus.TIMEDOUT, timedout);
        put(HostRoleStatus.SKIPPED_FAILED, skippedFailed);
    }

    @SuppressWarnings("boxing")
    private void put(HostRoleStatus status, Number number) {
        if (null != number) {
            m_counts.put(status, number.intValue());
            for (int i = 0; i < number.intValue(); i++) {
                m_tasksStatus.add(status);
            }
        } else {
            m_counts.put(status, 0);
        }
    }

    /**
     * @return the stage id for this summary
     */
    Long getStageId() {
        return m_stageId;
    }

    /**
     * @return the task result counts, by status
     */
    public Map<HostRoleStatus, Integer> getCounts() {
        return m_counts;
    }

    /**
     * @return the list of tasks status, expanded to cover all tasks for the stage
     */
    public List<HostRoleStatus> getTaskStatuses() {
        return m_tasksStatus;
    }

    /**
     * @return the total number of tasks for the stage
     */
    public int getTaskTotal() {
        return m_tasksStatus.size();
    }

    /**
     * @return {@code true} if the stage is skippable
     */
    public boolean isStageSkippable() {
        return m_skippable;
    }

    /**
     * @return the start time, minimum, for the tasks
     */
    public Long getStartTime() {
        return m_minTime;
    }

    /**
     * @return the end time, maximum, for the tasks
     */
    public Long getEndTime() {
        return m_maxTime;
    }

    /**
     * For testing, create an empty summary.
     */
    public static HostRoleCommandStatusSummaryDTO create() {
        return new HostRoleCommandStatusSummaryDTO(0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, // timedout
        0L, // skippedFailed
        0L);
    }

    /**
     * For testing, set the number of {@link HostRoleStatus#COMPLETED} tasks
     */
    public HostRoleCommandStatusSummaryDTO completed(int count) {
        put(HostRoleStatus.COMPLETED, Integer.valueOf(count));
        return this;
    }

    /**
     * For testing, set the number of {@link HostRoleStatus#FAILED} tasks
     */
    public HostRoleCommandStatusSummaryDTO failed(int count) {
        put(HostRoleStatus.FAILED, Integer.valueOf(count));
        return this;
    }

    /**
     * For testing, set the number of {@link HostRoleStatus#ABORTED} tasks
     */
    public HostRoleCommandStatusSummaryDTO aborted(int count) {
        put(HostRoleStatus.ABORTED, count);
        return this;
    }

    /**
     * For testing, set the number of {@link HostRoleStatus#TIMEDOUT} tasks
     */

    /**
     * For testing, set the number of {@link HostRoleStatus#IN_PROGRESS} tasks
     */
    public HostRoleCommandStatusSummaryDTO inProgress(int count) {
        put(HostRoleStatus.IN_PROGRESS, count);
        return this;
    }

    /**
     * For testing, set the number of {@link HostRoleStatus#PENDING} tasks
     */
    public HostRoleCommandStatusSummaryDTO pending(int count) {
        put(HostRoleStatus.PENDING, count);
        return this;
    }

    /**
     * For testing, set the number of {@link HostRoleStatus#QUEUED} tasks
     */
    public HostRoleCommandStatusSummaryDTO queued(int count) {
        put(HostRoleStatus.QUEUED, count);
        return this;
    }

    /**
     * For testing, set the number of {@link HostRoleStatus#SKIPPED_FAILED} tasks
     */
    public HostRoleCommandStatusSummaryDTO skippedFailed(int count) {
        put(HostRoleStatus.SKIPPED_FAILED, count);
        return this;
    }
}


for (int i = 0; i < number.intValue(); i++) {
                m_tasksStatus.add(status);
            }

package org.apache.ambari.server.orm.dao;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.ambari.server.actionmanager.HostRoleStatus;

/**
 * Summary for a single stage with summary counts for the tasks for that stage.
 */
public class HostRoleCommandStatusSummaryDTO {

    private Long m_stageId = Long.valueOf(0L);

    private Long m_minTime = Long.valueOf(0L);

    private Long m_maxTime = Long.valueOf(Long.MAX_VALUE);

    private boolean m_skippable = false;

    private Map<HostRoleStatus, Integer> m_counts = new HashMap<>();

    private List<HostRoleStatus> m_tasksStatus = new ArrayList<>();

    /**
     * Constructor invoked by JPA.  See {{@link HostRoleCommandDAO#findAggregateCounts(Long)}}
     */
    public HostRoleCommandStatusSummaryDTO(Number skippable, Number minStartTime, Number maxEndTime, Number stageId, Number aborted, Number completed, Number failed, Number holding, Number holdingFailed, Number holdingTimedout, Number inProgress, Number pending, Number queued, Number timedout, Number skippedFailed) {
        m_stageId = Long.valueOf(null == stageId ? 0L : stageId.longValue());
        if (null != skippable) {
            m_skippable = (1 == skippable.intValue());
        }
        if (null != minStartTime) {
            m_minTime = Long.valueOf(minStartTime.longValue());
        }
        if (null != maxEndTime) {
            m_maxTime = Long.valueOf(maxEndTime.longValue());
        }
        put(HostRoleStatus.ABORTED, aborted);
        put(HostRoleStatus.COMPLETED, completed);
        put(HostRoleStatus.FAILED, failed);
        put(HostRoleStatus.HOLDING, holding);
        put(HostRoleStatus.HOLDING_FAILED, holdingFailed);
        put(HostRoleStatus.HOLDING_TIMEDOUT, holdingTimedout);
        put(HostRoleStatus.IN_PROGRESS, inProgress);
        put(HostRoleStatus.PENDING, pending);
        put(HostRoleStatus.QUEUED, queued);
        put(HostRoleStatus.TIMEDOUT, timedout);
        put(HostRoleStatus.SKIPPED_FAILED, skippedFailed);
    }

    @SuppressWarnings("boxing")
    private void put(HostRoleStatus status, Number number) {
        if (null != number) {
            m_counts.put(status, number.intValue());

        } else {
            m_counts.put(status, 0);
        }
    }

    /**
     * @return the stage id for this summary
     */
    Long getStageId() {
        return m_stageId;
    }

    /**
     * @return the task result counts, by status
     */
    public Map<HostRoleStatus, Integer> getCounts() {
        return m_counts;
    }

    /**
     * @return the list of tasks status, expanded to cover all tasks for the stage
     */
    public List<HostRoleStatus> getTaskStatuses() {
        return m_tasksStatus;
    }

    /**
     * @return the total number of tasks for the stage
     */
    public int getTaskTotal() {
        return m_tasksStatus.size();
    }

    /**
     * @return {@code true} if the stage is skippable
     */
    public boolean isStageSkippable() {
        return m_skippable;
    }

    /**
     * @return the start time, minimum, for the tasks
     */
    public Long getStartTime() {
        return m_minTime;
    }

    /**
     * @return the end time, maximum, for the tasks
     */
    public Long getEndTime() {
        return m_maxTime;
    }

    /**
     * For testing, create an empty summary.
     */
    public static HostRoleCommandStatusSummaryDTO create() {
        return new HostRoleCommandStatusSummaryDTO(0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, // timedout
        0L, // skippedFailed
        0L);
    }

    /**
     * For testing, set the number of {@link HostRoleStatus#COMPLETED} tasks
     */
    public HostRoleCommandStatusSummaryDTO completed(int count) {
        put(HostRoleStatus.COMPLETED, Integer.valueOf(count));
        return this;
    }

    /**
     * For testing, set the number of {@link HostRoleStatus#FAILED} tasks
     */
    public HostRoleCommandStatusSummaryDTO failed(int count) {
        put(HostRoleStatus.FAILED, Integer.valueOf(count));
        return this;
    }

    /**
     * For testing, set the number of {@link HostRoleStatus#ABORTED} tasks
     */
    public HostRoleCommandStatusSummaryDTO aborted(int count) {
        put(HostRoleStatus.ABORTED, count);
        return this;
    }

    /**
     * For testing, set the number of {@link HostRoleStatus#TIMEDOUT} tasks
     */
    public HostRoleCommandStatusSummaryDTO timedout(int count) {
        put(HostRoleStatus.TIMEDOUT, count);
        return this;
    }

    /**
     * For testing, set the number of {@link HostRoleStatus#IN_PROGRESS} tasks
     */
    public HostRoleCommandStatusSummaryDTO inProgress(int count) {
        put(HostRoleStatus.IN_PROGRESS, count);
        return this;
    }

    /**
     * For testing, set the number of {@link HostRoleStatus#PENDING} tasks
     */
    public HostRoleCommandStatusSummaryDTO pending(int count) {
        put(HostRoleStatus.PENDING, count);
        return this;
    }

    /**
     * For testing, set the number of {@link HostRoleStatus#QUEUED} tasks
     */
    public HostRoleCommandStatusSummaryDTO queued(int count) {
        put(HostRoleStatus.QUEUED, count);
        return this;
    }

    /**
     * For testing, set the number of {@link HostRoleStatus#SKIPPED_FAILED} tasks
     */
    public HostRoleCommandStatusSummaryDTO skippedFailed(int count) {
        put(HostRoleStatus.SKIPPED_FAILED, count);
        return this;
    }
}


@Nullable
    public Duration getTimeout()

/*
 * Copyright The OpenTelemetry Authors
 */
package io.opentelemetry.instrumentation.spring.autoconfigure.exporters.otlp;

import java.time.Duration;
import javax.annotation.Nullable;
import org.springframework.boot.context.properties.ConfigurationProperties;

/**
 * Configuration for {@link io.opentelemetry.exporter.otlp.trace.OtlpGrpcSpanExporter}.
 *
 *
Get Exporter Service Name
 *
 *
Get Exporter Endpoint
 *
 *
Get max wait time for Collector to process Span Batches
 */
@ConfigurationProperties(prefix = "otel.exporter.otlp")
public final class OtlpGrpcSpanExporterProperties {

    private boolean enabled = true;

    @Nullable
    private String endpoint;

    @Nullable
    private Duration timeout;

    public boolean isEnabled() {
        return enabled;
    }

    public void setEnabled(boolean enabled) {
        this.enabled = enabled;
    }

    @Nullable
    public String getEndpoint() {
        return endpoint;
    }

    public void setEndpoint(String endpoint) {
        this.endpoint = endpoint;
    }

{
        return timeout;
    }

    public void setTimeout(Duration timeout) {
        this.timeout = timeout;
    }
}


/*
 * Copyright The OpenTelemetry Authors
 */
package io.opentelemetry.instrumentation.spring.autoconfigure.exporters.otlp;

import java.time.Duration;
import javax.annotation.Nullable;
import org.springframework.boot.context.properties.ConfigurationProperties;

/**
 * Configuration for {@link io.opentelemetry.exporter.otlp.trace.OtlpGrpcSpanExporter}.
 *
 *
Get Exporter Service Name
 *
 *
Get Exporter Endpoint
 *
 *
Get max wait time for Collector to process Span Batches
 */
@ConfigurationProperties(prefix = "otel.exporter.otlp")
public final class OtlpGrpcSpanExporterProperties {

    private boolean enabled = true;

    @Nullable
    private String endpoint;

    @Nullable
    private Duration timeout;

    public boolean isEnabled() {
        return enabled;
    }

    public void setEnabled(boolean enabled)

    @Nullable
    public String getEndpoint() {
        return endpoint;
    }

    public void setEndpoint(String endpoint) {
        this.endpoint = endpoint;
    }

    @Nullable
    public Duration getTimeout() {
        return timeout;
    }

    public void setTimeout(Duration timeout) {
        this.timeout = timeout;
    }
}


/*
 * Copyright The OpenTelemetry Authors
 */
package io.opentelemetry.instrumentation.spring.autoconfigure.exporters.otlp;

import java.time.Duration;
import javax.annotation.Nullable;
import org.springframework.boot.context.properties.ConfigurationProperties;

/**
 * Configuration for {@link io.opentelemetry.exporter.otlp.trace.OtlpGrpcSpanExporter}.
 *
 *
Get Exporter Service Name
 *
 *
Get Exporter Endpoint
 *
 *
Get max wait time for Collector to process Span Batches
 */
@ConfigurationProperties(prefix = "otel.exporter.otlp")
public final class OtlpGrpcSpanExporterProperties {

    private boolean enabled = true;

    @Nullable
    private String endpoint;

    @Nullable
    private Duration timeout;

    public boolean isEnabled() {
        return enabled;
    }

    public void setEnabled(boolean enabled) {
        this.enabled = enabled;
    }

    @Nullable
    public String getEndpoint() {
        return endpoint;
    }

    public void setEndpoint(String endpoint) {
        this.endpoint = endpoint;
    }

    @Nullable
    public Duration getTimeout() {
        return timeout;
    }

    public void setTimeout(Duration timeout) {
        this.timeout = time


package freenet.client.filter;

import java.nio.ByteBuffer;

public abstract class FlacPacket extends CodecPacket {

    FlacPacket(byte[] payload) {
        super(payload);
    }
}

class FlacMetadataBlock extends FlacPacket {

    enum BlockType {

        STREAMINFO,
        PADDING,
        APPLICATION,
        SEEKTABLE,
        VORBIS_COMMENT,
        CUESHEET,
        PICTURE,
        UNKNOWN,
        INVALID
    }

    private FlacMetadataBlockHeader header = new FlacMetadataBlockHeader();

    FlacMetadataBlock(int header, byte[] payload) {
        super(payload);
        this.header.lastMetadataBlock = ((header & 0x80000000) >>> 31) == 1 ? true : false;
        this.header.block_type = (byte) ((header & 0x7F000000) >>> 24);
        this.header.length = (header & 0x00FFFFFF);
    }

    @Override
    public byte[] toArray() {
        ByteBuffer bb = ByteBuffer.allocate(getLength());
        bb.putInt(header.toInt());
        bb.put(payload);
        return bb.array();
    }

    public boolean isLastMetadataBlock() {
        return header.lastMetadataBlock;
    }

{
        switch(header.block_type) {
            case 0:
                return BlockType.STREAMINFO;
            case 1:
                return BlockType.PADDING;
            case 2:
                return BlockType.APPLICATION;
            case 3:
                return BlockType.SEEKTABLE;
            case 4:
                return BlockType.VORBIS_COMMENT;
            case 5:
                return BlockType.CUESHEET;
            case 6:
                return BlockType.PICTURE;
            case 127:
                return BlockType.INVALID;
            default:
                return BlockType.UNKNOWN;
        }
    }

    public void setMetadataBlockType(BlockType type) {
        switch(type) {
            case STREAMINFO:
                this.header.block_type = 0;
                break;
            case PADDING:
                this.header.block_type = 1;
                break;
            case APPLICATION:
                this.header.block_type = 2;
                break;
            case SEEKTABLE:
                this.header.block_type = 3;
                break;
            case VORBIS_COMMENT:
                this.header.block_type = 4;
                break;
            case CUESHEET:
                this.header.block_type = 5;
                break;
            case PICTURE:
                this.header.block_type = 6;
                break;
        }
    }

    public FlacMetadataBlockHeader getHeader() {
        FlacMetadataBlockHeader newHeader = new FlacMetadataBlockHeader();
        newHeader.lastMetadataBlock = this.header.lastMetadataBlock;
        newHeader.block_type = this.header.block_type;
        newHeader.length = this.header.length;
        return newHeader;
    }

    public int getLength() {
        return 4 + header.length;
    }

    class FlacMetadataBlockHeader {

        boolean lastMetadataBlock;

        byte block_type;

        int length;

        public int toInt() {
            return ((lastMetadataBlock ? 1 : 0) << 31) | (block_type << 24) | length;
        }
    }
}

class FlacFrame extends FlacPacket {

    FlacFrame(byte[] payload) {
        super(payload);
    }
}


{
        return header.lastMetadataBlock;
    }

package freenet.client.filter;

import java.nio.ByteBuffer;

public abstract class FlacPacket extends CodecPacket {

    FlacPacket(byte[] payload) {
        super(payload);
    }
}

class FlacMetadataBlock extends FlacPacket {

    enum BlockType {

        STREAMINFO,
        PADDING,
        APPLICATION,
        SEEKTABLE,
        VORBIS_COMMENT,
        CUESHEET,
        PICTURE,
        UNKNOWN,
        INVALID
    }

    private FlacMetadataBlockHeader header = new FlacMetadataBlockHeader();

    FlacMetadataBlock(int header, byte[] payload) {
        super(payload);
        this.header.lastMetadataBlock = ((header & 0x80000000) >>> 31) == 1 ? true : false;
        this.header.block_type = (byte) ((header & 0x7F000000) >>> 24);
        this.header.length = (header & 0x00FFFFFF);
    }

    @Override
    public byte[] toArray() {
        ByteBuffer bb = ByteBuffer.allocate(getLength());
        bb.putInt(header.toInt());
        bb.put(payload);
        return bb.array();
    }

    public boolean isLastMetadataBlock()

    public BlockType getMetadataBlockType() {
        switch(header.block_type) {
            case 0:
                return BlockType.STREAMINFO;
            case 1:
                return BlockType.PADDING;
            case 2:
                return BlockType.APPLICATION;
            case 3:
                return BlockType.SEEKTABLE;
            case 4:
                return BlockType.VORBIS_COMMENT;
            case 5:
                return BlockType.CUESHEET;
            case 6:
                return BlockType.PICTURE;
            case 127:
                return BlockType.INVALID;
            default:
                return BlockType.UNKNOWN;
        }
    }

    public void setMetadataBlockType(BlockType type) {
        switch(type) {
            case STREAMINFO:
                this.header.block_type = 0;
                break;
            case PADDING:
                this.header.block_type = 1;
                break;
            case APPLICATION:
                this.header.block_type = 2;
                break;
            case SEEKTABLE:
                this.header.block_type = 3;
                break;
            case VORBIS_COMMENT:
                this.header.block_type = 4;
                break;
            case CUESHEET:
                this.header.block_type = 5;
                break;
            case PICTURE:
                this.header.block_type = 6;
                break;
        }
    }

    public FlacMetadataBlockHeader getHeader() {
        FlacMetadataBlockHeader newHeader = new FlacMetadataBlockHeader();
        newHeader.lastMetadataBlock = this.header.lastMetadataBlock;
        newHeader.block_type = this.header.block_type;
        newHeader.length = this.header.length;
        return newHeader;
    }

    public int getLength() {
        return 4 + header.length;
    }

    class FlacMetadataBlockHeader {

        boolean lastMetadataBlock;

        byte block_type;

        int length;

        public int toInt() {
            return ((lastMetadataBlock ? 1 : 0) << 31) | (block_type << 24) | length;
        }
    }
}

class FlacFrame extends FlacPacket {

    FlacFrame(byte[] payload) {
        super(payload);
    }
}


package freenet.client.filter;

import java.nio.ByteBuffer;

public abstract class FlacPacket extends CodecPacket {

    FlacPacket(byte[] payload) {
        super(payload);
    }
}

class FlacMetadataBlock extends FlacPacket {

    enum BlockType {

        STREAMINFO,
        PADDING,
        APPLICATION,
        SEEKTABLE,
        VORBIS_COMMENT,
        CUESHEET,
        PICTURE,
        UNKNOWN,
        INVALID
    }

    private FlacMetadataBlockHeader header = new FlacMetadataBlockHeader();

    FlacMetadataBlock(int header, byte[] payload) {
        super(payload);
        this.header.lastMetadataBlock = ((header & 0x80000000) >>> 31) == 1 ? true : false;
        this.header.block_type = (byte) ((header & 0x7F000000) >>> 24);
        this.header.length = (header & 0x00FFFFFF);
    }

    @Override
    public byte[] toArray() {
        ByteBuffer bb = ByteBuffer.allocate(getLength());
        bb.putInt(header.toInt());
        bb.put(pa

        return bb.array();
    }

    public boolean isLastMetadataBlock() {
        return header.lastMetadataBlock;
    }

    public BlockType getMetadataBlockType() {
        switch(header.block_type) {
            case 0:
                return BlockType.STREAMINFO;
            case 1:
                return BlockType.PADDING;
            case 2:
                return BlockType.APPLICATION;
            case 3:
                return BlockType.SEEKTABLE;
            case 4:
                return BlockType.VORBIS_COMMENT;
            case 5:
                return BlockType.CUESHEET;
            case 6:
                return BlockType.PICTURE;
            case 127:
                return BlockType.INVALID;
            default:
                return BlockType.UNKNOWN;
        }
    }

    public void setMetadataBlockType(BlockType type) {
        switch(type) {
            case STREAMINFO:
                this.header.block_type = 0;
                break;
            case PADDING:
                this.header.block_type = 1;
                break;
            case APPLICATION:
                this.header.block_type = 2;
                break;
            case SEEKTABLE:
                this.header.block_type = 3;
                break;
            case VORBIS_COMMENT:
                this.header.block_type = 4;
                break;
            case CUESHEET:
                this.header.block_type = 5;
                break;
            case PICTURE:
                this.header.block_type = 6;
                break;
        }
    }

    public FlacMetadataBlockHeader getHeader() {
        FlacMetadataBlockHeader newHeader = new FlacMetadataBlockHeader();
        newHeader.lastMetadataBlock = this.header.lastMetadataBlock;
        newHeader.block_type = this.header.block_type;
        newHeader.length = this.header.length;
        return newHeader;
    }

    public int getLength() {
        return 4 + header.length;
    }

    class FlacMetadataBlockHeader {

        boolean lastMetadataBlock;

        byte block_type;

        int length;

        public int toInt() {
            return ((lastMetadataBlock ? 1 : 0) << 31) | (block_type << 24) | length;
        }
    }
}

class FlacFrame extends FlacPacket {

    FlacFrame(byte[] payload) {
        super(payload);
    }
}


package com.alibaba.cobar.parser.ast.stmt.dal;

import com.alibaba.cobar.parser.ast.expression.Expression;
import com.alibaba.cobar.parser.ast.fragment.Limit;
import com.alibaba.cobar.parser.visitor.SQLASTVisitor;

/**
 * @author QIU Shuo
 */
public class ShowBinLogEvent extends DALShowStatement {

    private final String logName;

    private final Expression pos;

    private final Limit limit;

    public ShowBinLogEvent(String logName, Expression pos, Limit limit) {
        this.logName = logName;
        this.pos = pos;
        this.limit = limit;
    }

    public String getLogName() {
        return logName;
    }

    public Expression getPos() {
        return pos;
    }

{
        return limit;
    }

    @Override
    public void accept(SQLASTVisitor visitor) {
        visitor.visit(this);
    }
}


package com.alibaba.cobar.parser.ast.stmt.dal;

import com.alibaba.cobar.parser.ast.expression.Expression;
import com.alibaba.cobar.parser.ast.fragment.Limit;
import com.alibaba.cobar.parser.visitor.SQLASTVisitor;

/**
 * @author QIU Shuo
 */
public class ShowBinLogEvent extends DALShowStatement {

    private final String logName;

    private final Expression pos;

    private final Limit limit;

    public ShowBinLogEvent(String logName, Expression pos, Limit limit) {
        this.logName = logName;
        this.pos = pos;
        this.limit = limit;
    }

    public String getLogName()

    public Expression getPos() {
        return pos;
    }

    public Limit getLimit() {
        return limit;
    }

    @Override
    public void accept(SQLASTVisitor visitor) {
        visitor.visit(this);
    }
}


package com.alibaba.cobar.parser.ast.stmt.dal;

import com.alibaba.cobar.parser.ast.expression.Expression;
import com.alibaba.cobar.parser.ast.fragment.Limit;
import com.alibaba.cobar.parser.visitor.SQLASTVisitor;

/**
 * @author QIU Shuo
 */
public class ShowBinLogEvent extends DALShowStatement {

    private final String logName;

    private final Expression pos;

    private final Limit limit;

    public ShowBinLogEvent(String logName, Expression pos, Limit limit) {
        this.logName = logName;
        this.pos = pos;
        this.limit = limit;
    }

    public String getLogName() {
        return logName;
    }

    public Expression getPos() {
        return pos;
    }

    public Limit getLimit() {
        return limit;
    }

    @Override
    public void accept(SQLASTVisitor visitor) {


package io.mattw.youtube.commentsuite.fxml;

import com.google.common.eventbus.Subscribe;
import io.mattw.youtube.commentsuite.CommentSuite;
import io.mattw.youtube.commentsuite.db.CommentDatabase;
import io.mattw.youtube.commentsuite.db.YouTubeComment;
import io.mattw.youtube.commentsuite.events.TagsChangeEvent;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.scene.control.*;
import javafx.scene.layout.VBox;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import java.io.IOException;
import java.sql.SQLException;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import static javafx.application.Platform.runLater;

public class SCManageTagsModal extends VBox {

    private static final Logger logger = LogManager.getLogger();

    @FXML
    private Label lblAbout;

    @FXML
    private ListView<String> allTags;

    @FXML
    private TextField tags;

    @FXML
    private Button btnAdd, btnRemove, btnSelect, btnFinish;

    private final CommentDatabase database;

    private List<SearchCommentsListItem> selected;

    public SCManageTagsModal() {
        logger.debug("Initialize SCManageTagsModal");
        database = CommentSuite.getDatabase();
        CommentSuite.getEventBus().register(this);
        FXMLLoader loader = new FXMLLoader(getClass().getResource("SCManageTagsModal.fxml"));
        loader.setController(this);
        loader.setRoot(this);
        try {
            loader.load();
            allTags.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE);
            refreshAllTags();
            btnAdd.setOnAction(ae -> {
                try {
                    database.comments().associateTags(toComments(), toTags());
                } catch (SQLException e) {
                    e.printStackTrace();
                }
            });
            btnRemove.setOnAction(ae -> {
                try {
                    database.comments().deassociateTags(toComments(), toTags());
                } catch (SQLException e) {
                    e.printStackTrace();
                }
            });
            btnSelect.setOnAction(ae -> runLater(() -> tags.setText(String.join(", ", allTags.getSelectionModel().getSelectedItems()))));
        } catch (IOException e) {
            logger.error(e);
            e.printStackTrace();
        }
    }

    @Subscribe
    public void tagsChangeEvent(TagsChangeEvent tagsChangeEvent) {
        refreshAllTags();
    }

{
        try {
            final List<String> tags = database.comments().getAllTags();
            runLater(() -> {
                allTags.getItems().clear();
                allTags.getItems().addAll(tags);
            });
        } catch (SQLException e) {
            logger.error(e);
        }
    }

    public void withComments(List<SearchCommentsListItem> selected) {
        this.selected = selected;
        runLater(() -> lblAbout.setText(String.format("%s comments(s) selected", selected.size())));
    }

    public List<YouTubeComment> toComments() {
        return selected.stream().map(SearchCommentsListItem::getComment).collect(Collectors.toList());
    }

    public List<String> toTags() {
        return Stream.of(tags.getText().split(",")).map(String::trim).collect(Collectors.toList());
    }

    public Button getBtnFinish() {
        return btnFinish;
    }
}


{
        return Stream.of(tags.getText().split(",")).map(String::trim).collect(Collectors.toList());
    }

package io.mattw.youtube.commentsuite.fxml;

import com.google.common.eventbus.Subscribe;
import io.mattw.youtube.commentsuite.CommentSuite;
import io.mattw.youtube.commentsuite.db.CommentDatabase;
import io.mattw.youtube.commentsuite.db.YouTubeComment;
import io.mattw.youtube.commentsuite.events.TagsChangeEvent;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.scene.control.*;
import javafx.scene.layout.VBox;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import java.io.IOException;
import java.sql.SQLException;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import static javafx.application.Platform.runLater;

public class SCManageTagsModal extends VBox {

    private static final Logger logger = LogManager.getLogger();

    @FXML
    private Label lblAbout;

    @FXML
    private ListView<String> allTags;

    @FXML
    private TextField tags;

    @FXML
    private Button btnAdd, btnRemove, btnSelect, btnFinish;

    private final CommentDatabase database;

    private List<SearchCommentsListItem> selected;

    public SCManageTagsModal() {
        logger.debug("Initialize SCManageTagsModal");
        database = CommentSuite.getDatabase();
        CommentSuite.getEventBus().register(this);
        FXMLLoader loader = new FXMLLoader(getClass().getResource("SCManageTagsModal.fxml"));
        loader.setController(this);
        loader.setRoot(this);
        try {
            loader.load();
            allTags.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE);
            refreshAllTags();
            btnAdd.setOnAction(ae -> {
                try {
                    database.comments().associateTags(toComments(), toTags());
                } catch (SQLException e) {
                    e.printStackTrace();
                }
            });
            btnRemove.setOnAction(ae -> {
                try {
                    database.comments().deassociateTags(toComments(), toTags());
                } catch (SQLException e) {
                    e.printStackTrace();
                }
            });
            btnSelect.setOnAction(ae -> runLater(() -> tags.setText(String.join(", ", allTags.getSelectionModel().getSelectedItems()))));
        } catch (IOException e) {
            logger.error(e);
            e.printStackTrace();
        }
    }

    @Subscribe
    public void tagsChangeEvent(TagsChangeEvent tagsChangeEvent) {
        refreshAllTags();
    }

    private void refreshAllTags() {
        try {
            final List<String> tags = database.comments().getAllTags();
            runLater(() -> {
                allTags.getItems().clear();
                allTags.getItems().addAll(tags);
            });
        } catch (SQLException e) {
            logger.error(e);
        }
    }

    public void withComments(List<SearchCommentsListItem> selected) {
        this.selected = selected;
        runLater(() -> lblAbout.setText(String.format("%s comments(s) selected", selected.size())));
    }

    public List<YouTubeComment> toComments() {
        return selected.stream().map(SearchCommentsListItem::getComment).collect(Collectors.toList());
    }

    public List<String> toTags()

    public Button getBtnFinish() {
        return btnFinish;
    }
}


package io.mattw.youtube.commentsuite.fxml;

import com.google.common.eventbus.Subscribe;
import io.mattw.youtube.commentsuite.CommentSuite;
import io.mattw.youtube.commentsuite.db.CommentDatabase;
import io.mattw.youtube.commentsuite.db.YouTubeComment;
import io.mattw.youtube.commentsuite.events.TagsChangeEvent;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.scene.control.*;
import javafx.scene.layout.VBox;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import java.io.IOException;
import java.sql.SQLException;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import static javafx.application.Platform.runLater;

public class SCManageTagsModal extends VBox {

    private static final Logger logger = LogManager.getLogger();

    @FXML
    private Label lblAbout;

    @FXML
    private ListView<String> allTags;

    @FXML
    private TextField tags;

    @FXML
    private Button btnAdd, btnRemove, btnSelect, btnFinish;

    private final CommentDatabase database;

    private List<SearchCommentsListItem> selected;

    public SCManageTagsModal() {
        logger.debug("Initialize SCManageTagsModal");
        database = CommentSuite.getDatabase();
        CommentSuite.getEventBus().register(this);
        FXMLLoader loader = new FXMLLoader(getClass().getResource("SCManageTagsModal.fxml"));
        loader.setController(this);
        loader.setRoot(this);
        try {
            loader.load();
            allTags.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE);
            refreshAllTags();
            btnAdd.setOnAction(ae -> {
                try {
                    database.comments().associateTags(toComments(), toTags());
                } catch (SQLException e) {
                    e.printStackTrace();
                }
            });
            btnRemove.setOnAction(ae -> {
                try {
                    database.comments().deassociateTags(toComments(), toTags());
                } catch (SQLException e) {
                    e.printStackTrace();
                }
            });
            btnSelect.setOnAction(ae -> runLater(() -> tags.setText(String.join(", ", allTags.getSelectionModel().getSelectedItems()))));
        } catch (IOException e) {
            logger.error(e);
            e.printStackTrace();
        }
    }

    @Subscribe
    public void tagsChangeEvent(TagsChangeEvent tagsChangeEvent) {
        refreshAllTags();
    }

    private void refreshAllTags() {
        try {
            final List<String> tags = database.comments().getAllTags();
            runLater(() -> {
                allTags.getItems().clear();
                allTags.getItems().addAll(tags);
            });
        } catch (SQLException e) {
            logger.error(e);
        }
    }

    public void withComments(List<SearchCommentsListItem> selected) {
        this.selected = selected;
        runLater(() -> lblAbout.setText(String.format("%s comments(s) selected", selected.size())));
    }

    public List<YouTubeComment> toComments() {
        return selected.stream().map(SearchCommentsListItem::getComment).collect(Collectors.toList());
    }

    public List<String> toTags() {
        return Stream.of(tags.getText().split(",")).map(String::trim).collect

    }

    public Button getBtnFinish() {
        return btnFinish;
    }
}


try {
            final List<String> tags = database.comments().getAllTags();
            runLater(() -> {
                allTags.getItems().clear();
                allTags.getItems().addAll(tags);
            });
        } catch (SQLException e) {
            logger.error(e);
        }

package io.mattw.youtube.commentsuite.fxml;

import com.google.common.eventbus.Subscribe;
import io.mattw.youtube.commentsuite.CommentSuite;
import io.mattw.youtube.commentsuite.db.CommentDatabase;
import io.mattw.youtube.commentsuite.db.YouTubeComment;
import io.mattw.youtube.commentsuite.events.TagsChangeEvent;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.scene.control.*;
import javafx.scene.layout.VBox;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import java.io.IOException;
import java.sql.SQLException;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import static javafx.application.Platform.runLater;

public class SCManageTagsModal extends VBox {

    private static final Logger logger = LogManager.getLogger();

    @FXML
    private Label lblAbout;

    @FXML
    private ListView<String> allTags;

    @FXML
    private TextField tags;

    @FXML
    private Button btnAdd, btnRemove, btnSelect, btnFinish;

    private final CommentDatabase database;

    private List<SearchCommentsListItem> selected;

    public SCManageTagsModal() {
        logger.debug("Initialize SCManageTagsModal");
        database = CommentSuite.getDatabase();
        CommentSuite.getEventBus().register(this);
        FXMLLoader loader = new FXMLLoader(getClass().getResource("SCManageTagsModal.fxml"));
        loader.setController(this);
        loader.setRoot(this);
        try {
            loader.load();
            allTags.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE);
            refreshAllTags();
            btnAdd.setOnAction(ae -> {
                try {
                    database.comments().associateTags(toComments(), toTags());
                } catch (SQLException e) {
                    e.printStackTrace();
                }
            });
            btnRemove.setOnAction(ae -> {
                try {
                    database.comments().deassociateTags(toComments(), toTags());
                } catch (SQLException e) {
                    e.printStackTrace();
                }
            });
            btnSelect.setOnAction(ae -> runLater(() -> tags.setText(String.join(", ", allTags.getSelectionModel().getSelectedItems()))));
        } catch (IOException e) {
            logger.error(e);
            e.printStackTrace();
        }
    }

    @Subscribe
    public void tagsChangeEvent(TagsChangeEvent tagsChangeEvent) {
        refreshAllTags();
    }

    private void refreshAllTags() {

    }

    public void withComments(List<SearchCommentsListItem> selected) {
        this.selected = selected;
        runLater(() -> lblAbout.setText(String.format("%s comments(s) selected", selected.size())));
    }

    public List<YouTubeComment> toComments() {
        return selected.stream().map(SearchCommentsListItem::getComment).collect(Collectors.toList());
    }

    public List<String> toTags() {
        return Stream.of(tags.getText().split(",")).map(String::trim).collect(Collectors.toList());
    }

    public Button getBtnFinish() {
        return btnFinish;
    }
}


@Override
    protected String getPacketString()

package org.apache.activemq.artemis.core.protocol.core.impl.wireformat;

import org.apache.activemq.artemis.api.core.ActiveMQBuffer;
import org.apache.activemq.artemis.core.protocol.core.impl.PacketImpl;

public class SessionConsumerFlowCreditMessage extends PacketImpl {

    private long consumerID;

    private int credits;

    public SessionConsumerFlowCreditMessage(final long consumerID, final int credits) {
        super(SESS_FLOWTOKEN);
        this.consumerID = consumerID;
        this.credits = credits;
    }

    public SessionConsumerFlowCreditMessage() {
        super(SESS_FLOWTOKEN);
    }

    public long getConsumerID() {
        return consumerID;
    }

    public int getCredits() {
        return credits;
    }

    @Override
    public void encodeRest(final ActiveMQBuffer buffer) {
        buffer.writeLong(consumerID);
        buffer.writeInt(credits);
    }

    @Override
    public void decodeRest(final ActiveMQBuffer buffer) {
        consumerID = buffer.readLong();
        credits = buffer.readInt();
    }

{
        return super.getPacketString() + ", consumerID=" + consumerID + ", credits=" + credits;
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = super.hashCode();
        result = prime * result + (int) (consumerID ^ (consumerID >>> 32));
        result = prime * result + credits;
        return result;
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (!super.equals(obj))
            return false;
        if (!(obj instanceof SessionConsumerFlowCreditMessage))
            return false;
        SessionConsumerFlowCreditMessage other = (SessionConsumerFlowCreditMessage) obj;
        if (consumerID != other.consumerID)
            return false;
        if (credits != other.credits)
            return false;
        return true;
    }
}


{
        final int prime = 31;
        int result = super.hashCode();
        result = prime * result + (int) (consumerID ^ (consumerID >>> 32));
        result = prime * result + credits;
        return result;
    }

package org.apache.activemq.artemis.core.protocol.core.impl.wireformat;

import org.apache.activemq.artemis.api.core.ActiveMQBuffer;
import org.apache.activemq.artemis.core.protocol.core.impl.PacketImpl;

public class SessionConsumerFlowCreditMessage extends PacketImpl {

    private long consumerID;

    private int credits;

    public SessionConsumerFlowCreditMessage(final long consumerID, final int credits) {
        super(SESS_FLOWTOKEN);
        this.consumerID = consumerID;
        this.credits = credits;
    }

    public SessionConsumerFlowCreditMessage() {
        super(SESS_FLOWTOKEN);
    }

    public long getConsumerID() {
        return consumerID;
    }

    public int getCredits() {
        return credits;
    }

    @Override
    public void encodeRest(final ActiveMQBuffer buffer) {
        buffer.writeLong(consumerID);
        buffer.writeInt(credits);
    }

    @Override
    public void decodeRest(final ActiveMQBuffer buffer) {
        consumerID = buffer.readLong();
        credits = buffer.readInt();
    }

    @Override
    protected String getPacketString() {
        return super.getPacketString() + ", consumerID=" + consumerID + ", credits=" + credits;
    }

    @Override
    public int hashCode()

    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (!super.equals(obj))
            return false;
        if (!(obj instanceof SessionConsumerFlowCreditMessage))
            return false;
        SessionConsumerFlowCreditMessage other = (SessionConsumerFlowCreditMessage) obj;
        if (consumerID != other.consumerID)
            return false;
        if (credits != other.credits)
            return false;
        return true;
    }
}


her = (SessionConsumerFlowCreditMessage) obj;

package org.apache.activemq.artemis.core.protocol.core.impl.wireformat;

import org.apache.activemq.artemis.api.core.ActiveMQBuffer;
import org.apache.activemq.artemis.core.protocol.core.impl.PacketImpl;

public class SessionConsumerFlowCreditMessage extends PacketImpl {

    private long consumerID;

    private int credits;

    public SessionConsumerFlowCreditMessage(final long consumerID, final int credits) {
        super(SESS_FLOWTOKEN);
        this.consumerID = consumerID;
        this.credits = credits;
    }

    public SessionConsumerFlowCreditMessage() {
        super(SESS_FLOWTOKEN);
    }

    public long getConsumerID() {
        return consumerID;
    }

    public int getCredits() {
        return credits;
    }

    @Override
    public void encodeRest(final ActiveMQBuffer buffer) {
        buffer.writeLong(consumerID);
        buffer.writeInt(credits);
    }

    @Override
    public void decodeRest(final ActiveMQBuffer buffer) {
        consumerID = buffer.readLong();
        credits = buffer.readInt();
    }

    @Override
    protected String getPacketString() {
        return super.getPacketString() + ", consumerID=" + consumerID + ", credits=" + credits;
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = super.hashCode();
        result = prime * result + (int) (consumerID ^ (consumerID >>> 32));
        result = prime * result + credits;
        return result;
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (!super.equals(obj))
            return false;
        if (!(obj instanceof SessionConsumerFlowCreditMessage))
            return false;
        SessionConsumerFlowCreditMessage ot

        if (consumerID != other.consumerID)
            return false;
        if (credits != other.credits)
            return false;
        return true;
    }
}


private static boolean isValidHostAddress(InetAddress address)

package com.aliyun.polardbx.binlog;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.net.InetAddress;
import java.net.NetworkInterface;
import java.util.Enumeration;
import java.util.regex.Pattern;

/**
 * @author chengjin.lyf on 2020/7/22 4:51 下午
 * @since 1.0.25
 */
public class AddressUtil {

    private static final String LOCALHOST_IP = "127.0.0.1";

    private static final String EMPTY_IP = "0.0.0.0";

    private static final Pattern IP_PATTERN = Pattern.compile("[0-9]{1,3}(\\.[0-9]{1,3}){3,}");

    private static final Logger logger = LoggerFactory.getLogger(AddressUtil.class);

    public static InetAddress getHostAddress() {
        InetAddress localAddress = null;
        try {
            localAddress = InetAddress.getLocalHost();
            if (isValidHostAddress(localAddress)) {
                return localAddress;
            }
        } catch (Throwable e) {
            logger.warn("Failed to retriving local host ip address, try scan network card ip address. cause: " + e.getMessage());
        }
        try {
            Enumeration<NetworkInterface> interfaces = NetworkInterface.getNetworkInterfaces();
            if (interfaces != null) {
                while (interfaces.hasMoreElements()) {
                    try {
                        NetworkInterface network = interfaces.nextElement();
                        Enumeration<InetAddress> addresses = network.getInetAddresses();
                        if (addresses != null) {
                            while (addresses.hasMoreElements()) {
                                try {
                                    InetAddress address = addresses.nextElement();
                                    if (isValidHostAddress(address)) {
                                        return address;
                                    }
                                } catch (Throwable e) {
                                    logger.warn("Failed to retriving network card ip address. cause:" + e.getMessage());
                                }
                            }
                        }
                    } catch (Throwable e) {
                        logger.warn("Failed to retriving network card ip address. cause:" + e.getMessage());
                    }
                }
            }
        } catch (Throwable e) {
            logger.warn("Failed to retriving network card ip address. cause:" + e.getMessage());
        }
        logger.error("Could not get local host ip address, will use 127.0.0.1 instead.");
        return localAddress;
    }

{
        if (address == null || address.isLoopbackAddress()) {
            return false;
        }
        String name = address.getHostAddress();
        return (name != null && !EMPTY_IP.equals(name) && !LOCALHOST_IP.equals(name) && IP_PATTERN.matcher(name).matches());
    }
}


{
        if (address == null || address.isLoopbackAddress()) {
            return false;
        }
        String name = address.getHostAddress();
        return (name != null && !EMPTY_IP.equals(name) && !LOCALHOST_IP.equals(name) && IP_PATTERN.matcher(name).matches());
    }

package com.aliyun.polardbx.binlog;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.net.InetAddress;
import java.net.NetworkInterface;
import java.util.Enumeration;
import java.util.regex.Pattern;

/**
 * @author chengjin.lyf on 2020/7/22 4:51 下午
 * @since 1.0.25
 */
public class AddressUtil {

    private static final String LOCALHOST_IP = "127.0.0.1";

    private static final String EMPTY_IP = "0.0.0.0";

    private static final Pattern IP_PATTERN = Pattern.compile("[0-9]{1,3}(\\.[0-9]{1,3}){3,}");

    private static final Logger logger = LoggerFactory.getLogger(AddressUtil.class);

    public static InetAddress getHostAddress() {
        InetAddress localAddress = null;
        try {
            localAddress = InetAddress.getLocalHost();
            if (isValidHostAddress(localAddress)) {
                return localAddress;
            }
        } catch (Throwable e) {
            logger.warn("Failed to retriving local host ip address, try scan network card ip address. cause: " + e.getMessage());
        }
        try {
            Enumeration<NetworkInterface> interfaces = NetworkInterface.getNetworkInterfaces();
            if (interfaces != null) {
                while (interfaces.hasMoreElements()) {
                    try {
                        NetworkInterface network = interfaces.nextElement();
                        Enumeration<InetAddress> addresses = network.getInetAddresses();
                        if (addresses != null) {
                            while (addresses.hasMoreElements()) {
                                try {
                                    InetAddress address = addresses.nextElement();
                                    if (isValidHostAddress(address)) {
                                        return address;
                                    }
                                } catch (Throwable e) {
                                    logger.warn("Failed to retriving network card ip address. cause:" + e.getMessage());
                                }
                            }
                        }
                    } catch (Throwable e) {
                        logger.warn("Failed to retriving network card ip address. cause:" + e.getMessage());
                    }
                }
            }
        } catch (Throwable e) {
            logger.warn("Failed to retriving network card ip address. cause:" + e.getMessage());
        }
        logger.error("Could not get local host ip address, will use 127.0.0.1 instead.");
        return localAddress;
    }

    private static boolean isValidHostAddress(InetAddress address)


package com.aliyun.polardbx.binlog;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.net.InetAddress;
import java.net.NetworkInterface;
import java.util.Enumeration;
import java.util.regex.Pattern;

/**
 * @author chengjin.lyf on 2020/7/22 4:51 下午
 * @since 1.0.25
 */
public class AddressUtil {

    private static final String LOCALHOST_IP = "127.0.0.1";

    private static final String EMPTY_IP = "0.0.0.0";

    private static final Pattern IP_PATTERN = Pattern.compile("[0-9]{1,3}(\\.[0-9]{1,3}){3,}");

    private static final Logger logger = LoggerFactory.getLogger(AddressUtil.class);

    public static InetAddress getHostAddress() {
        InetAddress localAddress = null;
        try {
            localAddress = InetAddress.getLocalHost();
            if (isValidHostAddress(localAddress)) {
                return localAddress;
            }
        } catch (Throwable e) {
            logger.warn("Failed to retriving local host ip address, try scan network card ip address. cause: " + e.getMessage());
        }
        try {
            Enumeration<NetworkInterface> interfaces = NetworkInterface.getNetworkInterfaces();
            if (interfaces != null) {
                while (interfaces.hasMoreElements()) {
                    try {
                        NetworkInterface network = interfaces.nextElement();
                        Enumeration<InetAddress> addresses = network.getInetAddresses();
                        if (addresses != null) {
                            while (addresses.hasMoreElements()) {
                                try {
                                    InetAddress address = addresses.nextElement();
                                    if (isValidHostAddress(address)) {
                                        return address;
                                    }
                                } catch (Throwable e) {
                                    logger.warn("Failed to retriving network card ip address. cause:" + e.getMessage());
                                }
                            }
                        }
                    } catch (Throwable e) {
                        logger.warn("Failed to retriving network card ip address. cause:" + e.getMessage());
                    }
                }
            }
        } catch (Throwable e) {
            logger.warn("Failed to retriving network card ip address. cause:" + e.getMessage());
        }
        logger.error("Could not get local host ip address, will use 127.0.0.1 instead.");
        return localAddress;
    }

    private static boolean isValidHostAddress(InetAddress address) {
        if (address == null || address.isLoopbackAddress()) {
            return false;
        }
        String n

        return (name != null && !EMPTY_IP.equals(name) && !LOCALHOST_IP.equals(name) && IP_PATTERN.matcher(name).matches());
    }
}


try {
                                    InetAddress address = addresses.nextElement();
                                    if (isValidHostAddress(address)) {
                                        return address;
                                    }
                                } catch (Throwable e) {
                                    logger.warn("Failed to retriving network card ip address. cause:" + e.getMessage());
                                }

package com.aliyun.polardbx.binlog;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.net.InetAddress;
import java.net.NetworkInterface;
import java.util.Enumeration;
import java.util.regex.Pattern;

/**
 * @author chengjin.lyf on 2020/7/22 4:51 下午
 * @since 1.0.25
 */
public class AddressUtil {

    private static final String LOCALHOST_IP = "127.0.0.1";

    private static final String EMPTY_IP = "0.0.0.0";

    private static final Pattern IP_PATTERN = Pattern.compile("[0-9]{1,3}(\\.[0-9]{1,3}){3,}");

    private static final Logger logger = LoggerFactory.getLogger(AddressUtil.class);

    public static InetAddress getHostAddress() {
        InetAddress localAddress = null;
        try {
            localAddress = InetAddress.getLocalHost();
            if (isValidHostAddress(localAddress)) {
                return localAddress;
            }
        } catch (Throwable e) {
            logger.warn("Failed to retriving local host ip address, try scan network card ip address. cause: " + e.getMessage());
        }
        try {
            Enumeration<NetworkInterface> interfaces = NetworkInterface.getNetworkInterfaces();
            if (interfaces != null) {
                while (interfaces.hasMoreElements()) {
                    try {
                        NetworkInterface network = interfaces.nextElement();
                        Enumeration<InetAddress> addresses = network.getInetAddresses();
                        if (addresses != null) {
                            while (addresses.hasMoreElements()) {

                            }
                        }
                    } catch (Throwable e) {
                        logger.warn("Failed to retriving network card ip address. cause:" + e.getMessage());
                    }
                }
            }
        } catch (Throwable e) {
            logger.warn("Failed to retriving network card ip address. cause:" + e.getMessage());
        }
        logger.error("Could not get local host ip address, will use 127.0.0.1 instead.");
        return localAddress;
    }

    private static boolean isValidHostAddress(InetAddress address) {
        if (address == null || address.isLoopbackAddress()) {
            return false;
        }
        String name = address.getHostAddress();
        return (name != null && !EMPTY_IP.equals(name) && !LOCALHOST_IP.equals(name) && IP_PATTERN.matcher(name).matches());
    }
}


@Override
    protected final Object[][] getContents()

/*
 * COPYRIGHT AND PERMISSION NOTICE
 *
 */
package sun.util.resources.cldr.ext;

import sun.util.resources.TimeZoneNamesBundle;

public class TimeZoneNames_en_SD extends TimeZoneNamesBundle {

{
        final String[] Africa_Central = new String[] { "Central Africa Time", "CAT", "Central African Summer Time", "CAST", "Central Africa Time", "CAT" };
        final String[] Africa_Eastern = new String[] { "East Africa Time", "EAT", "Eastern African Summer Time", "EAST", "Eastern Africa Time", "EAT" };
        final String[] Africa_Southern = new String[] { "South Africa Standard Time", "SAST", "South Africa Summer Time", "SAST", "South Africa Time", "SAT" };
        final String[] Africa_Western = new String[] { "West Africa Standard Time", "WAT", "West Africa Summer Time", "WAST", "West Africa Time", "WAT" };
        final Object[][] data = new Object[][] { { "UTC", new String[] { "", "", "", "", "", "" } }, { "Africa/Nairobi", Africa_Eastern }, { "Africa/Libreville", Africa_Western }, { "Africa/Lusaka", Africa_Central }, { "Africa/Gaborone", Africa_Central }, { "Africa/Maputo", Africa_Central }, { "Africa/Windhoek", Africa_Central }, { "Africa/Mbabane", Africa_Southern }, { "Africa/Mogadishu", Africa_Eastern }, { "Asia/Famagusta", new String[] { "", "", "", "", "", "" } }, { "Africa/Harare", Africa_Central }, { "Africa/Douala", Africa_Western }, { "Pacific/Bougainville", new String[] { "", "", "", "", "", "" } }, { "Africa/Asmera", Africa_Eastern }, { "Europe/Ulyanovsk", new String[] { "", "", "", "", "", "" } }, { "Africa/Kampala", Africa_Eastern }, { "Africa/Sao_Tome", Africa_Western }, { "Africa/Khartoum", Africa_Central }, { "Africa/Malabo", Africa_Western }, { "Africa/Johannesburg", Africa_Southern }, { "Africa/Ndjamena", Africa_Western }, { "Africa/Bujumbura", Africa_Central }, { "Africa/Bangui", Africa_Western }, { "Africa/Lagos", Africa_Western }, { "Africa/Brazzaville", Africa_Western }, { "Africa/Luanda", Africa_Western }, { "Africa/Porto-Novo", Africa_Western }, { "Europe/Astrakhan", new String[] { "", "", "", "", "", "" } }, { "Africa/Juba", Africa_Eastern }, { "Asia/Srednekolymsk", new String[] { "", "", "", "", "", "" } }, { "Europe/Saratov", new String[] { "", "", "", "", "", "" } }, { "Africa/Dar_es_Salaam", Africa_Eastern }, { "Antarctica/Palmer", new String[] { "", "", "", "", "", "" } }, { "Africa/Maseru", Africa_Southern }, { "Africa/Kinshasa", Africa_Western }, { "Africa/Addis_Ababa", Africa_Eastern }, { "Africa/Lubumbashi", Africa_Central }, { "Africa/Djibouti", Africa_Eastern }, { "Africa/Kigali", Africa_Central }, { "Indian/Antananarivo", Africa_Eastern }, { "America/Punta_Arenas", new String[] { "", "", "", "", "", "" } }, { "Africa/Niamey", Africa_Western }, { "Indian/Mayotte", Africa_Eastern }, { "Africa/Blantyre", Africa_Central }, { "Indian/Comoro", Africa_Eastern } };
        return data;
    }
}


ica Time", "EAT", "Eastern African Summer Time", "EAST", "Eastern Africa Time", "EAT" };

/*
 * COPYRIGHT AND PERMISSION NOTICE
 *
 */
package sun.util.resources.cldr.ext;

import sun.util.resources.TimeZoneNamesBundle;

public class TimeZoneNames_en_SD extends TimeZoneNamesBundle {

    @Override
    protected final Object[][] getContents() {
        final String[] Africa_Central = new String[] { "Central Africa Time", "CAT", "Central African Summer Time", "CAST", "Central Africa Time", "CAT" };
        final String[] Africa_Eastern = new String[] { "East Afr

        final String[] Africa_Southern = new String[] { "South Africa Standard Time", "SAST", "South Africa Summer Time", "SAST", "South Africa Time", "SAT" };
        final String[] Africa_Western = new String[] { "West Africa Standard Time", "WAT", "West Africa Summer Time", "WAST", "West Africa Time", "WAT" };
        final Object[][] data = new Object[][] { { "UTC", new String[] { "", "", "", "", "", "" } }, { "Africa/Nairobi", Africa_Eastern }, { "Africa/Libreville", Africa_Western }, { "Africa/Lusaka", Africa_Central }, { "Africa/Gaborone", Africa_Central }, { "Africa/Maputo", Africa_Central }, { "Africa/Windhoek", Africa_Central }, { "Africa/Mbabane", Africa_Southern }, { "Africa/Mogadishu", Africa_Eastern }, { "Asia/Famagusta", new String[] { "", "", "", "", "", "" } }, { "Africa/Harare", Africa_Central }, { "Africa/Douala", Africa_Western }, { "Pacific/Bougainville", new String[] { "", "", "", "", "", "" } }, { "Africa/Asmera", Africa_Eastern }, { "Europe/Ulyanovsk", new String[] { "", "", "", "", "", "" } }, { "Africa/Kampala", Africa_Eastern }, { "Africa/Sao_Tome", Africa_Western }, { "Africa/Khartoum", Africa_Central }, { "Africa/Malabo", Africa_Western }, { "Africa/Johannesburg", Africa_Southern }, { "Africa/Ndjamena", Africa_Western }, { "Africa/Bujumbura", Africa_Central }, { "Africa/Bangui", Africa_Western }, { "Africa/Lagos", Africa_Western }, { "Africa/Brazzaville", Africa_Western }, { "Africa/Luanda", Africa_Western }, { "Africa/Porto-Novo", Africa_Western }, { "Europe/Astrakhan", new String[] { "", "", "", "", "", "" } }, { "Africa/Juba", Africa_Eastern }, { "Asia/Srednekolymsk", new String[] { "", "", "", "", "", "" } }, { "Europe/Saratov", new String[] { "", "", "", "", "", "" } }, { "Africa/Dar_es_Salaam", Africa_Eastern }, { "Antarctica/Palmer", new String[] { "", "", "", "", "", "" } }, { "Africa/Maseru", Africa_Southern }, { "Africa/Kinshasa", Africa_Western }, { "Africa/Addis_Ababa", Africa_Eastern }, { "Africa/Lubumbashi", Africa_Central }, { "Africa/Djibouti", Africa_Eastern }, { "Africa/Kigali", Africa_Central }, { "Indian/Antananarivo", Africa_Eastern }, { "America/Punta_Arenas", new String[] { "", "", "", "", "", "" } }, { "Africa/Niamey", Africa_Western }, { "Indian/Mayotte", Africa_Eastern }, { "Africa/Blantyre", Africa_Central }, { "Indian/Comoro", Africa_Eastern } };
        return data;
    }
}