/*
 * The Alluxio Open Foundation licenses this work under the Apache License, version 2.0
 * (the “License”). You may not use this work except in compliance with the License, which is
 * available at www.apache.org/licenses/LICENSE-2.0
 *
 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
 * either express or implied, as more fully set forth in the License.
 *
 * See the NOTICE file distributed with this work for information regarding copyright ownership.
 */

package alluxio.security.authentication;

import alluxio.Configuration;
import alluxio.Constants;

import com.google.common.base.Preconditions;
import org.apache.thrift.transport.TFramedTransport;
import org.apache.thrift.transport.TTransport;
import org.apache.thrift.transport.TTransportFactory;

import java.net.InetSocketAddress;

import javax.annotation.concurrent.ThreadSafe;
import javax.security.sasl.SaslException;

/**
 * If authentication type is {@link AuthType#NOSASL), be default we use this transport provider
 * which simply uses default Thrift {@link TFramedTransport}.
 */
@ThreadSafe
public final class NoSaslTransportProvider implements TransportProvider {
  /** Timtout for socket in ms. */
  private int mSocketTimeoutMs;

  /**
   * Constructor for transport provider when authentication type is {@link AuthType#NOSASL).
   * @param conf Alluxio configuration
   */
  public NoSaslTransportProvider(Configuration conf) {
    Preconditions.checkNotNull(conf);
    mSocketTimeoutMs = conf.getInt(Constants.SECURITY_AUTHENTICATION_SOCKET_TIMEOUT_MS);
  }

  @Override
  public TTransport getClientTransport(InetSocketAddress serverAddress) {
    TTransport tTransport =
        TransportProviderUtils.createThriftSocket(serverAddress, mSocketTimeoutMs);
    return new TFramedTransport(tTransport);
  }

  @Override
  public TTransportFactory getServerTransportFactory() throws SaslException {
    return new TFramedTransport.Factory();
  }
}

@@ -1193,17 +1193,17 @@
  /** Tim
-t
+e
 out for 
@@ -1250,16 +1250,105 @@
 meoutMs;
+%0A  /** Max frame size of thrift transport in bytes. */%0A  private int mThriftFrameSizeMax;
 %0A%0A  /**%0A
@@ -1667,16 +1667,102 @@
 UT_MS);%0A
+    mThriftFrameSizeMax = (int) conf.getBytes(Constants.THRIFT_FRAME_SIZE_BYTES_MAX);%0A
   %7D%0A%0A  @
@@ -1998,16 +1998,37 @@
 ransport
+, mThriftFrameSizeMax
 );%0A  %7D%0A%0A
@@ -2117,16 +2117,16 @@
 ption %7B%0A
-
     retu
@@ -2157,16 +2157,35 @@
 Factory(
+mThriftFrameSizeMax
 );%0A  %7D%0A%7D

Fix code that was lost during merge