conflict_resolution
stringlengths 27
16k
|
---|
<<<<<<<
@RolesAllowed( { "Peer-Management|Write", "Peer-Management|Update" } )
@Override
public boolean update( final PeerInfo peerInfo )
{
String source;
if ( peerInfo.getId().compareTo( localPeer.getId() ) == 0 )
{
source = SOURCE_LOCAL_PEER;
}
else
{
source = SOURCE_REMOTE_PEER;
}
return peerDAO.saveInfo( source, peerInfo.getId(), peerInfo );
}
=======
// @RolesAllowed( { "Peer-Management|A|Write", "Peer-Management|A|Update" } )
// @Override
// public boolean update( final PeerInfo peerInfo )
// {
// String source;
// if ( peerInfo.getId().compareTo( localPeer.getId() ) == 0 )
// {
// source = SOURCE_LOCAL_PEER;
// }
// else
// {
// source = SOURCE_REMOTE_PEER;
// }
// return peerDAO.saveInfo( source, peerInfo.getId(), peerInfo );
// }
>>>>>>>
// @RolesAllowed( { "Peer-Management|A|Write", "Peer-Management|A|Update" } )
// @Override
// public boolean update( final PeerInfo peerInfo )
// {
// String source;
// if ( peerInfo.getId().compareTo( localPeer.getId() ) == 0 )
// {
// source = SOURCE_LOCAL_PEER;
// }
// else
// {
// source = SOURCE_REMOTE_PEER;
// }
// return peerDAO.saveInfo( source, peerInfo.getId(), peerInfo );
// }
<<<<<<<
@RolesAllowed( { "Peer-Management|Write", "Peer-Management|Update" } )
=======
protected PeerInfo getRemotePeerInfo( String destinationHost ) throws PeerException
{
return registrationClient.getPeerInfo( destinationHost );
}
@RolesAllowed( { "Peer-Management|A|Write", "Peer-Management|A|Update" } )
>>>>>>>
protected PeerInfo getRemotePeerInfo( String destinationHost ) throws PeerException
{
return registrationClient.getPeerInfo( destinationHost );
}
@RolesAllowed( { "Peer-Management|Write", "Peer-Management|Update" } ) |
<<<<<<<
public static long getUserid(HttpServletRequest req, HttpServletResponse res, String cookiePath) {
=======
public static long getUserid(HttpServletRequest req, HttpServletResponse res, String cookiePath, int maxAge) {
>>>>>>>
public static long getUserid(HttpServletRequest req, HttpServletResponse res, String cookiePath, int maxAge) {
<<<<<<<
public static long getUserid(ServerHttpRequest req, ServerHttpResponse res, String cookiePath) {
try {
String cookie = req.getHeaders().getFirst("Cookie");
if (cookie != null) {
int x1 = cookie.indexOf(SCOUTE_R);
if (x1 >= 0) {
String value = null;
int x2 = cookie.indexOf(';', x1);
if (x2 > 0) {
value = cookie.substring(x1 + SCOUTE_R.length() + 1, x2);
} else {
value = cookie.substring(x1 + SCOUTE_R.length() + 1);
}
try {
return Hexa32.toLong32(value);
} catch (Throwable th) {
}
}
}
ResponseCookie.ResponseCookieBuilder c = ResponseCookie
.from(SCOUTE_R, Hexa32.toString32(KeyGen.next()));
if ( cookiePath != null && cookiePath.trim().length() > 0 ) {
c.path(cookiePath);
}
c.maxAge(Integer.MAX_VALUE);
res.addCookie(c.build());
} catch (Throwable t) {
Logger.println("A153", t.toString());
}
return 0;
}
public static long getUseridCustom(HttpServletRequest req, HttpServletResponse res, String key) {
=======
public static long getUseridCustom(HttpServletRequest req, String key) {
>>>>>>>
public static long getUserid(ServerHttpRequest req, ServerHttpResponse res, String cookiePath) {
try {
String cookie = req.getHeaders().getFirst("Cookie");
if (cookie != null) {
int x1 = cookie.indexOf(SCOUTE_R);
if (x1 >= 0) {
String value = null;
int x2 = cookie.indexOf(';', x1);
if (x2 > 0) {
value = cookie.substring(x1 + SCOUTE_R.length() + 1, x2);
} else {
value = cookie.substring(x1 + SCOUTE_R.length() + 1);
}
try {
return Hexa32.toLong32(value);
} catch (Throwable th) {
}
}
}
ResponseCookie.ResponseCookieBuilder c = ResponseCookie
.from(SCOUTE_R, Hexa32.toString32(KeyGen.next()));
if ( cookiePath != null && cookiePath.trim().length() > 0 ) {
c.path(cookiePath);
}
c.maxAge(Integer.MAX_VALUE);
res.addCookie(c.build());
} catch (Throwable t) {
Logger.println("A153", t.toString());
}
return 0;
}
public static long getUseridCustom(HttpServletRequest req, String key) {
<<<<<<<
public static long getUseridCustom(ServerHttpRequest req, ServerHttpResponse res, String key) {
if (key == null || key.length() == 0)
return 0;
try {
String cookie = req.getHeaders().getFirst("Cookie");
if (cookie != null) {
int x1 = cookie.indexOf(key);
if (x1 >= 0) {
String value = null;
int x2 = cookie.indexOf(';', x1);
if (x2 > 0) {
value = cookie.substring(x1 + key.length() + 1, x2);
} else {
value = cookie.substring(x1 + key.length() + 1);
}
if (value != null) {
return HashUtil.hash(value);
}
}
}
} catch (Throwable t) {
Logger.println("A154", t.toString());
}
return 0;
}
public static long getUseridFromHeader(HttpServletRequest req, HttpServletResponse res, String key) {
=======
public static long getUseridFromHeader(HttpServletRequest req, String key) {
>>>>>>>
public static long getUseridCustom(ServerHttpRequest req, ServerHttpResponse res, String key) {
if (key == null || key.length() == 0)
return 0;
try {
String cookie = req.getHeaders().getFirst("Cookie");
if (cookie != null) {
int x1 = cookie.indexOf(key);
if (x1 >= 0) {
String value = null;
int x2 = cookie.indexOf(';', x1);
if (x2 > 0) {
value = cookie.substring(x1 + key.length() + 1, x2);
} else {
value = cookie.substring(x1 + key.length() + 1);
}
if (value != null) {
return HashUtil.hash(value);
}
}
}
} catch (Throwable t) {
Logger.println("A154", t.toString());
}
return 0;
}
public static long getUseridFromHeader(HttpServletRequest req, String key) { |
<<<<<<<
import org.safehaus.subutai.common.protocol.Container;
import org.safehaus.subutai.common.util.ServiceLocator;
=======
>>>>>>>
<<<<<<<
public ContainerHost getContainerHostByUUID( UUID uuid ) {
Iterator<ContainerHost> iterator = containers.iterator();
iterator.next();
while ( iterator.hasNext() ) {
ContainerHost containerHost = iterator.next();
if ( containerHost.getId().equals( uuid ) )
return containerHost;
}
return null;
}
/*public void invoke( PeerCommandMessage commandMessage )
{
try
{
EnvironmentManager environmentManager = this.serviceLocator.getServiceNoCache( EnvironmentManager.class );
environmentManager.invoke( commandMessage );
}
catch ( NamingException e )
{
commandMessage.setProccessed( true );
commandMessage.setExceptionMessage( e.toString() );
// commandMessage.setSuccess( false );
}
}*/
=======
>>>>>>>
public ContainerHost getContainerHostByUUID( UUID uuid ) {
Iterator<ContainerHost> iterator = containers.iterator();
iterator.next();
while ( iterator.hasNext() ) {
ContainerHost containerHost = iterator.next();
if ( containerHost.getId().equals( uuid ) )
return containerHost;
}
return null;
} |
<<<<<<<
@GsonRequired
=======
@JsonProperty( "name" )
>>>>>>>
@GsonRequired
@JsonProperty( "name" )
<<<<<<<
@GsonRequired
=======
@JsonProperty( "templateName" )
>>>>>>>
@GsonRequired
@JsonProperty( "templateName" )
<<<<<<<
@GsonRequired
private ContainerType type;
@GsonRequired( validation = GsonValidation.GREATER_THAN_ZERO )
=======
@JsonProperty( "type" )
private ContainerType type = ContainerType.SMALL;
@JsonProperty( "numberOfContainers" )
>>>>>>>
@GsonRequired
@JsonProperty( "type" )
private ContainerType type = ContainerType.SMALL;
@GsonRequired( validation = GsonValidation.GREATER_THAN_ZERO )
@JsonProperty( "numberOfContainers" )
<<<<<<<
@GsonRequired
=======
@JsonProperty( "sshGroupId" )
>>>>>>>
@GsonRequired
@JsonProperty( "sshGroupId" )
<<<<<<<
@GsonRequired
=======
@JsonProperty( "hostsGroupId" )
>>>>>>>
@GsonRequired
@JsonProperty( "hostsGroupId" )
<<<<<<<
@GsonRequired
=======
@JsonProperty( "peerId" )
>>>>>>>
@GsonRequired
@JsonProperty( "peerId" ) |
<<<<<<<
new SetupN2NStep( topology, environment, peerManager ).execute();
=======
new SetupP2PStep( topology, environment ).execute();
>>>>>>>
new SetupP2PStep( topology, environment, peerManager ).execute(); |
<<<<<<<
protected Button getButton( final HorizontalLayout availableOperationsLayout, String caption )
{
if ( availableOperationsLayout == null )
{
return null;
}
else
{
for ( Component component : availableOperationsLayout )
{
if ( component.getCaption().equals( caption ) )
{
return ( Button ) component;
}
}
return null;
}
}
=======
>>>>>>>
<<<<<<<
Notification.show( notification );
}
public Table createTableTemplate( String caption )
{
=======
>>>>>>>
<<<<<<<
protected Agent getAgentByRow( final Item row )
{
if ( row == null )
{
return null;
}
Set<Agent> clusterNodeList = config.getAllOozieAgents();
String lxcHostname = row.getItemProperty( HOST_COLUMN_CAPTION ).getValue().toString();
for ( Agent agent : clusterNodeList )
{
if ( agent.getHostname().equals( lxcHostname ) )
{
return agent;
}
}
return null;
}
private Label getStatusLabel( final HorizontalLayout statusGroupLayout )
{
if ( statusGroupLayout == null )
{
return null;
}
return ( Label ) statusGroupLayout.getComponent( 0 );
}
=======
>>>>>>> |
<<<<<<<
import org.safehaus.subutai.plugin.common.api.NodeType;
import org.safehaus.subutai.plugin.common.api.OperationType;
=======
import org.safehaus.subutai.plugin.common.api.NodeOperationType;
>>>>>>>
import org.safehaus.subutai.plugin.common.api.NodeType;
import org.safehaus.subutai.plugin.common.api.NodeOperationType; |
<<<<<<<
/**
* Returns list of ports, mapped using 'subutai map' command. See https://github.com/subutai-io/subos/wiki/Map
* @param host RH host
* @return
*/
List<ReservedPortMapping> getReservedPortMappings( final Host host ) throws NetworkManagerException;
/**
* Check if port is already mapped using 'subutai map' command
* @param host RH host on which to check mapping existence
* @param protocol
* @param externalPort
* @param ipAddress IP address of container of Resource Host
* @param internalPort
* @return
*/
boolean isPortMappingReserved( final Host host, final Protocol protocol, final int externalPort,
final String ipAddress, final int internalPort ) throws NetworkManagerException;
=======
ReservedPorts getContainerPortMappings( final Host host, final Protocol protocol ) throws NetworkManagerException;
>>>>>>>
ReservedPorts getContainerPortMappings( final Host host, final Protocol protocol ) throws NetworkManagerException;
/**
* Returns list of ports, mapped using 'subutai map' command. See https://github.com/subutai-io/subos/wiki/Map
* @param host RH host
* @return
*/
List<ReservedPortMapping> getReservedPortMappings( final Host host ) throws NetworkManagerException;
/**
* Check if port is already mapped using 'subutai map' command
* @param host RH host on which to check mapping existence
* @param protocol
* @param externalPort
* @param ipAddress IP address of container of Resource Host
* @param internalPort
* @return
*/
boolean isPortMappingReserved( final Host host, final Protocol protocol, final int externalPort,
final String ipAddress, final int internalPort ) throws NetworkManagerException; |
<<<<<<<
Criteria criteria = session.createCriteria(ProcedureHistoryEntity.class);
criteria.add(Restrictions.eq(ProcedureHistoryEntity.PROCEDURE, procedure));
criteria.createCriteria(ProcedureHistoryEntity.PROCEDURE_DESCRIPTION_FORMAT).add(
Restrictions.eq(FormatEntity.FORMAT, procedureDescriptionFormat));
=======
Criteria criteria = session.createCriteria(ValidProcedureTime.class);
criteria.add(Restrictions.eq(ValidProcedureTime.PROCEDURE, procedure));
if (procedureDescriptionFormat != null && !procedureDescriptionFormat.isEmpty()) {
criteria.createCriteria(ValidProcedureTime.PROCEDURE_DESCRIPTION_FORMAT).add(
Restrictions.eq(ProcedureDescriptionFormat.PROCEDURE_DESCRIPTION_FORMAT, procedureDescriptionFormat));
}
>>>>>>>
Criteria criteria = session.createCriteria(ProcedureHistoryEntity.class);
criteria.add(Restrictions.eq(ProcedureHistoryEntity.PROCEDURE, procedure));
if (procedureDescriptionFormat != null && !procedureDescriptionFormat.isEmpty()) {
criteria.createCriteria(ProcedureHistoryEntity.PROCEDURE_DESCRIPTION_FORMAT).add(
Restrictions.eq(FormatEntity.FORMAT, procedureDescriptionFormat));
} |
<<<<<<<
private HashPartitioner hashPartitioner;
=======
private String hashtag;
>>>>>>>
private HashPartitioner hashPartitioner;
private String hashtag;
<<<<<<<
public HashPartitioner getHashPartitioner() {
return hashPartitioner;
}
public ConnectionPoolConfigurationImpl withHashPartitioner(HashPartitioner hPartitioner) {
hashPartitioner = hPartitioner;
return this;
}
=======
public ConnectionPoolConfigurationImpl withHashtag(String htag) {
hashtag = htag;
return this;
}
>>>>>>>
public HashPartitioner getHashPartitioner() {
return hashPartitioner;
}
public ConnectionPoolConfigurationImpl withHashPartitioner(HashPartitioner hPartitioner) {
hashPartitioner = hPartitioner;
return this;
}
public ConnectionPoolConfigurationImpl withHashtag(String htag) {
hashtag = htag;
return this;
} |
<<<<<<<
remotePeer.checkRelation();
String path =
String.format( "/%s/container/%s/start", containerId.getEnvironmentId().getId(), containerId.getId() );
WebClient client = WebClientBuilder.buildEnvironmentWebClient( peerInfo, path, provider );
client.type( MediaType.APPLICATION_JSON );
client.accept( MediaType.APPLICATION_JSON );
client.get();
=======
Response response = client.get();
if ( response.getStatus() == 500 )
{
throw new PeerException( response.readEntity( String.class ) );
}
>>>>>>>
remotePeer.checkRelation();
String path =
String.format( "/%s/container/%s/start", containerId.getEnvironmentId().getId(), containerId.getId() );
WebClient client = WebClientBuilder.buildEnvironmentWebClient( peerInfo, path, provider );
client.type( MediaType.APPLICATION_JSON );
client.accept( MediaType.APPLICATION_JSON );
Response response = client.get();
if ( response.getStatus() == 500 )
{
throw new PeerException( response.readEntity( String.class ) );
}
<<<<<<<
remotePeer.checkRelation();
String path = String.format( "/%s/container/stop", containerId.getEnvironmentId().getId() );
WebClient client = WebClientBuilder.buildEnvironmentWebClient( peerInfo, path, provider );
client.type( MediaType.APPLICATION_JSON );
client.accept( MediaType.APPLICATION_JSON );
client.post( containerId );
=======
final Response response = client.post( containerId );
if ( response.getStatus() == 500 )
{
throw new PeerException( response.readEntity( String.class ) );
}
>>>>>>>
remotePeer.checkRelation();
String path = String.format( "/%s/container/stop", containerId.getEnvironmentId().getId() );
WebClient client = WebClientBuilder.buildEnvironmentWebClient( peerInfo, path, provider );
client.type( MediaType.APPLICATION_JSON );
client.accept( MediaType.APPLICATION_JSON );
final Response response = client.post( containerId );
if ( response.getStatus() == 500 )
{
throw new PeerException( response.readEntity( String.class ) );
}
<<<<<<<
remotePeer.checkRelation();
String path = String.format( "/%s/container/destroy", containerId.getEnvironmentId().getId() );
WebClient client = WebClientBuilder.buildEnvironmentWebClient( peerInfo, path, provider );
client.type( MediaType.APPLICATION_JSON );
client.accept( MediaType.APPLICATION_JSON );
client.post( containerId );
=======
final Response response = client.post( containerId );
if ( response.getStatus() == 500 )
{
throw new PeerException( response.readEntity( String.class ) );
}
>>>>>>>
remotePeer.checkRelation();
String path = String.format( "/%s/container/destroy", containerId.getEnvironmentId().getId() );
WebClient client = WebClientBuilder.buildEnvironmentWebClient( peerInfo, path, provider );
client.type( MediaType.APPLICATION_JSON );
client.accept( MediaType.APPLICATION_JSON );
final Response response = client.post( containerId );
if ( response.getStatus() == 500 )
{
throw new PeerException( response.readEntity( String.class ) );
}
<<<<<<<
remotePeer.checkRelation();
String path =
String.format( "/%s/container/%s/usage/%d", containerId.getEnvironmentId().getId(), containerId.getId(),
pid );
WebClient client = WebClientBuilder.buildEnvironmentWebClient( peerInfo, path, provider );
client.type( MediaType.APPLICATION_JSON );
client.accept( MediaType.APPLICATION_JSON );
return client.get( ProcessResourceUsage.class );
=======
final Response response = client.get();
if ( response.getStatus() == 500 )
{
throw new PeerException( response.readEntity( String.class ) );
}
else
{
return response.readEntity( ProcessResourceUsage.class );
}
>>>>>>>
remotePeer.checkRelation();
String path =
String.format( "/%s/container/%s/usage/%d", containerId.getEnvironmentId().getId(), containerId.getId(),
pid );
WebClient client = WebClientBuilder.buildEnvironmentWebClient( peerInfo, path, provider );
client.type( MediaType.APPLICATION_JSON );
client.accept( MediaType.APPLICATION_JSON );
final Response response = client.get();
if ( response.getStatus() == 500 )
{
throw new PeerException( response.readEntity( String.class ) );
}
else
{
return response.readEntity( ProcessResourceUsage.class );
} |
<<<<<<<
=======
import javax.sql.DataSource;
import java.sql.*;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import java.util.concurrent.ExecutorService;
>>>>>>>
import javax.sql.DataSource;
import java.sql.*;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import java.util.concurrent.ExecutorService;
<<<<<<<
@Ignore
=======
public void testUninstallCluster()
{
UUID id = sharkImpl.uninstallCluster("test");
// asserts
verify(executor).execute(isA(AbstractOperationHandler.class));
assertEquals(uuid, id);
}
@Test
>>>>>>>
public void testUninstallCluster()
{
UUID id = sharkImpl.uninstallCluster("test");
// asserts
verify(executor).execute( isA( AbstractOperationHandler.class ) );
assertEquals( uuid, id );
}
@Test
@Ignore |
<<<<<<<
client.type( MediaType.APPLICATION_JSON );
client.accept( MediaType.TEXT_PLAIN );
=======
client.type( MediaType.APPLICATION_JSON );
client.accept( MediaType.APPLICATION_JSON );
>>>>>>>
client.type( MediaType.APPLICATION_JSON );
client.accept( MediaType.APPLICATION_JSON );
<<<<<<<
public Gateways getGateways() throws PeerException
{
try
{
remotePeer.checkRelation();
String path = "/gateways";
WebClient client = WebClientBuilder.buildPeerWebClient( peerInfo, path, provider );
client.type( MediaType.APPLICATION_JSON );
client.accept( MediaType.APPLICATION_JSON );
Response response = client.get();
if ( response.getStatus() == 500 )
{
throw new PeerException( response.readEntity( String.class ) );
}
else
{
return response.readEntity( Gateways.class );
}
}
catch ( Exception e )
{
LOG.error( e.getMessage(), e );
throw new PeerException( "Error getting gateways", e );
}
}
public Vnis getReservedVnis() throws PeerException
{
try
{
remotePeer.checkRelation();
String path = "/vni";
WebClient client = WebClientBuilder.buildPeerWebClient( peerInfo, path, provider );
client.type( MediaType.APPLICATION_JSON );
client.accept( MediaType.APPLICATION_JSON );
final Response response = client.get();
if ( response.getStatus() == 500 )
{
throw new PeerException( response.readEntity( String.class ) );
}
else
{
return response.readEntity( Vnis.class );
}
}
catch ( Exception e )
{
LOG.error( e.getMessage(), e );
throw new PeerException( String.format( "Error obtaining reserved VNIs from peer %s", peerInfo ), e );
}
}
public Vni reserveVni( final Vni vni ) throws PeerException
{
try
{
remotePeer.checkRelation();
String path = "/vni";
WebClient client = WebClientBuilder.buildPeerWebClient( peerInfo, path, provider );
client.type( MediaType.APPLICATION_JSON );
client.accept( MediaType.APPLICATION_JSON );
final Response response = client.post( vni );
if ( response.getStatus() == 500 )
{
throw new PeerException( response.readEntity( String.class ) );
}
else
{
return response.readEntity( Vni.class );
}
}
catch ( Exception e )
{
throw new PeerException( "Error on reserving VNI", e );
}
}
=======
>>>>>>>
<<<<<<<
try
=======
WebClient client = WebClientBuilder.buildPeerWebClient( peerInfo, path, provider, 3000, 7000, 1 );
client.type( MediaType.APPLICATION_JSON );
client.accept( MediaType.TEXT_PLAIN );
final Response response = client.post( p2pIps );
if ( response.getStatus() == 500 )
>>>>>>>
try |
<<<<<<<
void approveUser(String userName, int type);
/* *************************************************
*
*/
void signUp( String username, String pwd, String fullName, String email, String keyAscii );
/* *************************************************
*
*/
User createUser( String userName, String password, String fullName, String email, int type );
=======
User createUser( String userName, String password, String fullName, String email, int type, String publicKey );
>>>>>>>
void approveUser(String userName, int type);
/* *************************************************
*
*/
void signUp( String username, String pwd, String fullName, String email, String keyAscii );
/* *************************************************
*
*/
User createUser( String userName, String password, String fullName, String email, int type, String publicKey ); |
<<<<<<<
import org.safehaus.subutai.common.peer.PeerPolicy;
=======
import org.safehaus.subutai.common.peer.PeerStatus;
>>>>>>>
import org.safehaus.subutai.common.peer.PeerPolicy;
import org.safehaus.subutai.common.peer.PeerStatus;
<<<<<<<
public Response getPeerPolicy( final String peerId ) {
Preconditions.checkState( UUIDUtil.isStringAUuid( peerId ) );
LocalPeer localPeer = peerManager.getLocalPeer();
PeerPolicy peerPolicy = localPeer.getPeerInfo().getPeerPolicy( UUID.fromString( peerId ) );
if ( peerPolicy == null ) {
return Response.ok().build();
} else {
return Response.ok( JsonUtil.toJson( JsonUtil.toJson( peerPolicy ) ) ).build();
}
}
@Override
=======
public Response getRegisteredPeerInfo( final String peerId )
{
PeerInfo peerInfo = peerManager.getPeer( peerId ).getPeerInfo();
return Response.ok( JsonUtil.toJson( peerInfo ) ).build();
}
@Override
>>>>>>>
public Response getPeerPolicy( final String peerId ) {
Preconditions.checkState( UUIDUtil.isStringAUuid( peerId ) );
LocalPeer localPeer = peerManager.getLocalPeer();
PeerPolicy peerPolicy = localPeer.getPeerInfo().getPeerPolicy( UUID.fromString( peerId ) );
if ( peerPolicy == null ) {
return Response.ok().build();
}
else {
return Response.ok( JsonUtil.toJson( JsonUtil.toJson( peerPolicy ) ) ).build();
}
}
@Override
public Response getRegisteredPeerInfo( final String peerId )
{
PeerInfo peerInfo = peerManager.getPeer( peerId ).getPeerInfo();
return Response.ok( JsonUtil.toJson( peerInfo ) ).build();
}
@Override |
<<<<<<<
import io.subutai.common.gson.required.GsonRequired;
import io.subutai.common.util.CollectionUtil;
=======
>>>>>>>
import io.subutai.common.gson.required.GsonRequired;
import io.subutai.common.util.CollectionUtil;
<<<<<<<
public Blueprint( @JsonProperty( "environmentId" ) final String environmentId,
@JsonProperty( "name" ) final String name,
@JsonProperty( "cidr" ) final String cidr,
@JsonProperty( "sshKey" ) final String sshKey,
=======
public Blueprint( @JsonProperty( "name" ) final String name, @JsonProperty( "sshKey" ) final String sshKey,
>>>>>>>
public Blueprint( @JsonProperty( "name" ) final String name, @JsonProperty( "sshKey" ) final String sshKey, |
<<<<<<<
import com.vaadin.ui.Button;
import com.vaadin.ui.Tree;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.ui.Window;
=======
import com.vaadin.ui.*;
import org.safehaus.kiskis.mgmt.server.ui.util.AppData;
>>>>>>>
import com.vaadin.ui.AbstractSelect;
import com.vaadin.ui.Button;
import com.vaadin.ui.Component;
import com.vaadin.ui.Tree;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.ui.Window;
<<<<<<<
tree.setItemIconPropertyId("icon");
=======
tree.setItemDescriptionGenerator(new AbstractSelect.ItemDescriptionGenerator() {
@Override
public String generateDescription(Component source, Object itemId,
Object propertyId) {
Item item = tree.getItem(itemId);
Agent agent = (Agent) item.getItemProperty("value").getValue();
return "Hostname: " + agent.getHostname() + "\t" +
"Is LXC: " + agent.isIsLXC() + "\t" +
"IP: " + agent.getListIP();
}
});
>>>>>>>
tree.setItemIconPropertyId("icon");
tree.setItemDescriptionGenerator(new AbstractSelect.ItemDescriptionGenerator() {
@Override
public String generateDescription(Component source, Object itemId,
Object propertyId) {
Item item = tree.getItem(itemId);
Agent agent = (Agent) item.getItemProperty("value").getValue();
return "Hostname: " + agent.getHostname() + "\t"
+ "Is LXC: " + agent.isIsLXC() + "\t"
+ "IP: " + agent.getListIP();
}
}); |
<<<<<<<
import java.util.*;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
=======
import org.safehaus.kiskis.mgmt.api.agentmanager.AgentManager;
>>>>>>>
import java.util.*;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import org.safehaus.kiskis.mgmt.api.agentmanager.AgentManager; |
<<<<<<<
import io.subutai.core.kurjun.api.TemplateManager;
import io.subutai.common.peer.ContainerQuota;
=======
>>>>>>>
import io.subutai.core.kurjun.api.TemplateManager;
import io.subutai.common.peer.ContainerQuota;
<<<<<<<
private TemplateManager templateManager;
private String defaultQuota;
=======
>>>>>>>
private TemplateManager templateManager;
private String defaultQuota;
<<<<<<<
@RolesAllowed( "Environment-Management|A|Write" )
@Override
public ContainerHost createContainer( final ResourceHost resourceHost, final Template template,
final String containerName ) throws PeerException
{
Preconditions.checkNotNull( resourceHost, "Resource host is null value" );
Preconditions.checkNotNull( template, "Pass valid template object" );
Preconditions
.checkArgument( !Strings.isNullOrEmpty( containerName ), "Cannot create container with null name" );
getResourceHostByName( resourceHost.getHostname() );
if ( getTemplate( template.getTemplateName() ) == null )
{
throw new PeerException( String.format( "Template %s not registered", template.getTemplateName() ) );
}
try
{
return resourceHost.createContainer( template.getTemplateName(), containerName, 180 );
}
catch ( ResourceHostException e )
{
LOG.error( "Failed to create container", e );
throw new PeerException( e );
}
}
=======
>>>>>>> |
<<<<<<<
import org.hl7.fhir.r4.model.*;
=======
import org.joda.time.DateTime;
import org.joda.time.DateTimeZone;
>>>>>>>
import org.hl7.fhir.r4.model.*;
<<<<<<<
Instant instant = ZonedDateTime.of(
LocalDate.of(2013, 7, 1),
LocalTime.of(13, 11, 13),
ZoneId.of("UTC")
).toInstant();
Date timestamp = Date.from(instant);
DocumentReference reference = new DocumentReference();
=======
var timestamp = new DateTime()
.withDate(2013, 7, 1)
.withTime(13, 11, 33, 0)
.withZone(DateTimeZone.UTC).toDate();
var reference = new DocumentReference();
>>>>>>>
var instant = ZonedDateTime.of(
LocalDate.of(2013, 7, 1),
LocalTime.of(13, 11, 13),
ZoneId.of("UTC")
).toInstant();
var timestamp = Date.from(instant);
var reference = new DocumentReference(); |
<<<<<<<
LOGGER.debug( encryptedMessage );
LOGGER.debug( delegatedUser.getId() );
}
catch ( NamingException e )
{
LOGGER.error( "Relation Manager service is unavailable", e );
=======
LOGGER.info( encryptedMessage );
LOGGER.info( delegatedUser.getId() );
>>>>>>>
LOGGER.debug( encryptedMessage );
LOGGER.debug( delegatedUser.getId() );
}
catch ( NamingException e )
{
LOGGER.error( "Relation Manager service is unavailable", e );
<<<<<<<
=======
>>>>>>> |
<<<<<<<
import javax.annotation.security.PermitAll;
import javax.annotation.security.RolesAllowed;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
=======
>>>>>>>
import javax.annotation.security.PermitAll;
import javax.annotation.security.RolesAllowed;
<<<<<<<
catch ( Exception e )
{
throw new PeerException( String.format( "Error cleaning up network on peer %s", getName() ), e );
}
}
@PermitAll
@Override
public boolean isConnected( final Host containerHost )
{
Preconditions.checkNotNull( containerHost, "Container host is null" );
Preconditions.checkArgument( containerHost instanceof EnvironmentContainerHost );
EnvironmentContainerHost host = ( EnvironmentContainerHost ) containerHost;
String path = "peer/container/isconnected";
Map<String, String> params = Maps.newHashMap();
params.put( "containerId", host.getId() );
//*********construct Secure Header ****************************
Map<String, String> headers = Maps.newHashMap();
String envHeaderSource = localPeer.getId() + "-" + host.getEnvironmentId();
String envHeaderTarget = peerInfo.getId() + "-" + host.getEnvironmentId();
headers.put( Common.HEADER_SPECIAL, "ENC" );
headers.put( Common.HEADER_ENV_ID_SOURCE, envHeaderSource );
headers.put( Common.HEADER_ENV_ID_TARGET, envHeaderTarget );
//*************************************************************
try
{
String alias = SecuritySettings.KEYSTORE_PX2_ROOT_ALIAS;
return jsonUtil.from( post( path, alias, params, headers ), Boolean.class );
}
catch ( Exception e )
=======
else
>>>>>>>
else
<<<<<<<
@RolesAllowed( "Environment-Management|A|Write" )
=======
>>>>>>>
@RolesAllowed( "Environment-Management|A|Write" ) |
<<<<<<<
import org.hl7.fhir.r4.model.*;
=======
import org.hl7.fhir.r4.model.Attachment;
import org.hl7.fhir.r4.model.Binary;
import org.hl7.fhir.r4.model.Bundle;
import org.hl7.fhir.r4.model.Coding;
import org.hl7.fhir.r4.model.DocumentManifest;
import org.hl7.fhir.r4.model.DocumentReference;
import org.hl7.fhir.r4.model.Enumerations;
import org.hl7.fhir.r4.model.Identifier;
import org.hl7.fhir.r4.model.Narrative;
import org.hl7.fhir.r4.model.OperationOutcome;
import org.hl7.fhir.r4.model.Practitioner;
import org.hl7.fhir.r4.model.Reference;
import org.joda.time.DateTime;
import org.joda.time.DateTimeZone;
>>>>>>>
import org.hl7.fhir.r4.model.Attachment;
import org.hl7.fhir.r4.model.Binary;
import org.hl7.fhir.r4.model.Bundle;
import org.hl7.fhir.r4.model.Coding;
import org.hl7.fhir.r4.model.DocumentManifest;
import org.hl7.fhir.r4.model.DocumentReference;
import org.hl7.fhir.r4.model.Enumerations;
import org.hl7.fhir.r4.model.Identifier;
import org.hl7.fhir.r4.model.Narrative;
import org.hl7.fhir.r4.model.OperationOutcome;
import org.hl7.fhir.r4.model.Practitioner;
import org.hl7.fhir.r4.model.Reference;
<<<<<<<
import java.util.Date;
=======
>>>>>>>
import java.util.Date;
<<<<<<<
Instant instant = ZonedDateTime.of(
LocalDate.of(2013, 7, 1),
LocalTime.of(13, 11, 13),
ZoneId.of("UTC")
).toInstant();
Date timestamp = Date.from(instant);
=======
var timestamp = new DateTime()
.withDate(2013, 7, 1)
.withTime(13, 11, 33, 0)
.withZone(DateTimeZone.UTC).toDate();
>>>>>>>
var instant = ZonedDateTime.of(
LocalDate.of(2013, 7, 1),
LocalTime.of(13, 11, 13),
ZoneId.of("UTC")
).toInstant();
var timestamp = Date.from(instant); |
<<<<<<<
=======
if (deferModelScanning) {
fhirContext.setPerformanceOptions(PerformanceOptionsEnum.DEFERRED_MODEL_SCANNING);
}
fhirValidator.initialize(fhirContext);
>>>>>>>
fhirValidator.initialize(fhirContext); |
<<<<<<<
import org.safehaus.subutai.shared.operation.AbstractOperationHandler;
import org.safehaus.subutai.shared.protocol.ClusterConfigurationException;
=======
import org.safehaus.subutai.common.protocol.AbstractOperationHandler;
import org.safehaus.subutai.common.tracker.ProductOperation;
import org.safehaus.subutai.common.exception.ClusterConfigurationException;
>>>>>>>
import org.safehaus.subutai.common.protocol.AbstractOperationHandler;
import org.safehaus.subutai.common.exception.ClusterConfigurationException; |
<<<<<<<
/*
* Copyright (C) 2012-2017 52°North Initiative for Geospatial Open Source
=======
/**
* Copyright (C) 2012-2017 52°North Initiative for Geospatial Open Source
>>>>>>>
/*
* Copyright (C) 2012-2017 52°North Initiative for Geospatial Open Source
<<<<<<<
import org.n52.shetland.ogc.gml.time.Time;
import org.n52.shetland.ogc.gml.time.TimeInstant;
import org.n52.shetland.ogc.gml.time.TimePeriod;
import org.n52.shetland.ogc.om.MultiObservationValues;
import org.n52.shetland.ogc.om.ObservationValue;
import org.n52.shetland.ogc.om.OmConstants;
import org.n52.shetland.ogc.om.OmObservation;
import org.n52.shetland.ogc.om.OmObservationConstellation;
import org.n52.shetland.ogc.om.SingleObservationValue;
import org.n52.shetland.ogc.om.values.BooleanValue;
import org.n52.shetland.ogc.om.values.CategoryValue;
import org.n52.shetland.ogc.om.values.ComplexValue;
import org.n52.shetland.ogc.om.values.CountValue;
import org.n52.shetland.ogc.om.values.QuantityValue;
import org.n52.shetland.ogc.om.values.SweDataArrayValue;
import org.n52.shetland.ogc.om.values.TextValue;
import org.n52.shetland.ogc.om.values.Value;
import org.n52.shetland.ogc.ows.exception.CodedException;
import org.n52.shetland.ogc.ows.exception.NoApplicableCodeException;
import org.n52.shetland.ogc.ows.exception.OwsExceptionReport;
import org.n52.shetland.ogc.swe.SweAbstractDataComponent;
import org.n52.shetland.ogc.swe.SweDataRecord;
import org.n52.shetland.ogc.swe.SweField;
import org.n52.shetland.ogc.swe.simpleType.SweAbstractSimpleType;
import org.n52.shetland.ogc.swe.simpleType.SweBoolean;
import org.n52.shetland.ogc.swe.simpleType.SweCategory;
import org.n52.shetland.ogc.swe.simpleType.SweCount;
import org.n52.shetland.ogc.swe.simpleType.SweQuantity;
import org.n52.shetland.ogc.swe.simpleType.SweText;
import org.n52.shetland.ogc.swe.simpleType.SweTime;
import org.n52.shetland.ogc.swe.simpleType.SweTimeRange;
import org.n52.shetland.util.DateTimeHelper;
import org.n52.shetland.util.DateTimeParseException;
=======
import org.n52.sos.ds.hibernate.dao.observation.ValueCreatingSweDataComponentVisitor;
import org.n52.sos.exception.CodedException;
import org.n52.sos.exception.ows.NoApplicableCodeException;
import org.n52.sos.ogc.gml.AbstractFeature;
import org.n52.sos.ogc.gml.CodeWithAuthority;
import org.n52.sos.ogc.gml.ReferenceType;
import org.n52.sos.ogc.gml.time.Time;
import org.n52.sos.ogc.gml.time.TimeInstant;
import org.n52.sos.ogc.gml.time.TimePeriod;
import org.n52.sos.ogc.om.MultiObservationValues;
import org.n52.sos.ogc.om.NamedValue;
import org.n52.sos.ogc.om.ObservationMergeIndicator;
import org.n52.sos.ogc.om.ObservationMerger;
import org.n52.sos.ogc.om.ObservationValue;
import org.n52.sos.ogc.om.OmConstants;
import org.n52.sos.ogc.om.OmObservableProperty;
import org.n52.sos.ogc.om.OmObservation;
import org.n52.sos.ogc.om.OmObservationConstellation;
import org.n52.sos.ogc.om.ParameterHolder;
import org.n52.sos.ogc.om.SingleObservationValue;
import org.n52.sos.ogc.om.features.samplingFeatures.SamplingFeature;
import org.n52.sos.ogc.om.values.BooleanValue;
import org.n52.sos.ogc.om.values.CategoryValue;
import org.n52.sos.ogc.om.values.ComplexValue;
import org.n52.sos.ogc.om.values.CountValue;
import org.n52.sos.ogc.om.values.ProfileLevel;
import org.n52.sos.ogc.om.values.ProfileValue;
import org.n52.sos.ogc.om.values.QuantityValue;
import org.n52.sos.ogc.om.values.SweDataArrayValue;
import org.n52.sos.ogc.om.values.TextValue;
import org.n52.sos.ogc.om.values.Value;
import org.n52.sos.ogc.ows.OwsExceptionReport;
import org.n52.sos.ogc.sensorML.SensorML;
import org.n52.sos.ogc.sos.SosProcedureDescription;
import org.n52.sos.ogc.swe.SweAbstractDataComponent;
import org.n52.sos.ogc.swe.SweCoordinate;
import org.n52.sos.ogc.swe.SweDataRecord;
import org.n52.sos.ogc.swe.SweField;
import org.n52.sos.ogc.swe.SweVector;
import org.n52.sos.ogc.swe.simpleType.SweAbstractSimpleType;
import org.n52.sos.ogc.swe.simpleType.SweBoolean;
import org.n52.sos.ogc.swe.simpleType.SweCategory;
import org.n52.sos.ogc.swe.simpleType.SweCount;
import org.n52.sos.ogc.swe.simpleType.SweQuantity;
import org.n52.sos.ogc.swe.simpleType.SweText;
import org.n52.sos.ogc.swe.simpleType.SweTime;
import org.n52.sos.ogc.swe.simpleType.SweTimeRange;
import org.n52.sos.util.Constants;
import org.n52.sos.util.DateTimeHelper;
import org.n52.sos.util.GeometryHandler;
import org.n52.sos.util.IncDecInteger;
import org.n52.sos.util.JTSHelper;
import org.n52.sos.util.SosHelper;
import org.n52.sos.util.SweHelper;
>>>>>>>
import org.n52.shetland.ogc.gml.time.Time;
import org.n52.shetland.ogc.gml.time.TimeInstant;
import org.n52.shetland.ogc.gml.time.TimePeriod;
import org.n52.shetland.ogc.om.MultiObservationValues;
import org.n52.shetland.ogc.om.ObservationValue;
import org.n52.shetland.ogc.om.OmConstants;
import org.n52.shetland.ogc.om.OmObservation;
import org.n52.shetland.ogc.om.OmObservationConstellation;
import org.n52.shetland.ogc.om.SingleObservationValue;
import org.n52.shetland.ogc.om.values.BooleanValue;
import org.n52.shetland.ogc.om.values.CategoryValue;
import org.n52.shetland.ogc.om.values.ComplexValue;
import org.n52.shetland.ogc.om.values.CountValue;
import org.n52.shetland.ogc.om.values.QuantityValue;
import org.n52.shetland.ogc.om.values.SweDataArrayValue;
import org.n52.shetland.ogc.om.values.TextValue;
import org.n52.shetland.ogc.om.values.Value;
import org.n52.shetland.ogc.ows.exception.CodedException;
import org.n52.shetland.ogc.ows.exception.NoApplicableCodeException;
import org.n52.shetland.ogc.ows.exception.OwsExceptionReport;
import org.n52.shetland.ogc.swe.SweAbstractDataComponent;
import org.n52.shetland.ogc.swe.SweDataRecord;
import org.n52.shetland.ogc.swe.SweField;
import org.n52.shetland.ogc.swe.simpleType.SweAbstractSimpleType;
import org.n52.shetland.ogc.swe.simpleType.SweBoolean;
import org.n52.shetland.ogc.swe.simpleType.SweCategory;
import org.n52.shetland.ogc.swe.simpleType.SweCount;
import org.n52.shetland.ogc.swe.simpleType.SweQuantity;
import org.n52.shetland.ogc.swe.simpleType.SweText;
import org.n52.shetland.ogc.swe.simpleType.SweTime;
import org.n52.shetland.ogc.swe.simpleType.SweTimeRange;
import org.n52.shetland.util.DateTimeHelper;
import org.n52.shetland.util.DateTimeParseException;
import org.n52.sos.util.GeometryHandler;
import org.n52.sos.util.IncDecInteger;
import org.n52.sos.util.JTSHelper;
import org.n52.sos.util.SosHelper;
import org.n52.sos.util.SweHelper;
<<<<<<<
* @author <a href="mailto:[email protected]">Christian Autermann</a>
=======
*
* @author Christian Autermann <[email protected]>
>>>>>>>
* @author <a href="mailto:[email protected]">Christian Autermann</a>
<<<<<<<
final List<OmObservation> observationCollection = new ArrayList<>();
=======
final List<OmObservation> observationCollection = new ArrayList<OmObservation>();
Map<String, AbstractFeature> features = new HashMap<>();
Map<String, SosProcedureDescription> procedures = new HashMap<>();
boolean complex = false;
>>>>>>>
final List<OmObservation> observationCollection = new ArrayList<>();
Map<String, AbstractFeature> features = new HashMap<>();
Map<String, SosProcedureDescription> procedures = new HashMap<>();
boolean complex = false;
<<<<<<<
=======
GeometryHolder samplingGeometry = new GeometryHolder();
ParameterHolder parameterHolder = new ParameterHolder();
String featureOfInterest = null;
String procedure = null;
>>>>>>>
GeometryHolder samplingGeometry = new GeometryHolder();
ParameterHolder parameterHolder = new ParameterHolder();
String featureOfInterest = null;
String procedure = null;
<<<<<<<
observedValue = parseSweDataRecord(((SweDataRecord) dataComponent).copy(), block, tokenIndex);
=======
try {
if (dataComponent.getDefinition().contains(OmConstants.OM_PARAMETER)) {
parseDataRecordAsParameter((SweDataRecord)dataComponent, block, tokenIndex, parameterHolder);
} else {
observedValue =
parseSweDataRecord(((SweDataRecord) dataComponent).clone(), block, tokenIndex);
}
} catch (CloneNotSupportedException e) {
throw new NoApplicableCodeException().causedBy(e).withMessage(
"Unable to copy element '%s'.", dataComponent.getClass().getName());
}
} else if (dataComponent instanceof SweVector) {
try {
parseSweVectorAsGeometry(((SweVector) dataComponent).clone(), block, tokenIndex,
samplingGeometry);
} catch (CloneNotSupportedException e) {
throw new NoApplicableCodeException().causedBy(e).withMessage(
"Unable to copy element '%s'.", dataComponent.getClass().getName());
}
>>>>>>>
try {
if (dataComponent.getDefinition().contains(OmConstants.OM_PARAMETER)) {
parseDataRecordAsParameter((SweDataRecord)dataComponent, block, tokenIndex, parameterHolder);
} else {
observedValue =
parseSweDataRecord(((SweDataRecord) dataComponent).copy(), block, tokenIndex);
}
} catch (CloneNotSupportedException e) {
throw new NoApplicableCodeException().causedBy(e).withMessage(
"Unable to copy element '%s'.", dataComponent.getClass().getName());
}
} else if (dataComponent instanceof SweVector) {
try {
parseSweVectorAsGeometry(((SweVector) dataComponent).copy(), block, tokenIndex,
samplingGeometry);
} catch (CloneNotSupportedException e) {
throw new NoApplicableCodeException().causedBy(e).withMessage(
"Unable to copy element '%s'.", dataComponent.getClass().getName());
}
<<<<<<<
private Value<?> parseSweDataRecord(SweDataRecord record, List<String> block, int tokenIndex) throws CodedException {
=======
private Value<?> parseSweDataRecord(SweDataRecord record, List<String> block, IncDecInteger tokenIndex)
throws CodedException {
boolean tokenIndexIncreased = false;
>>>>>>>
private Value<?> parseSweDataRecord(SweDataRecord record, List<String> block, IncDecInteger tokenIndex)
throws CodedException {
<<<<<<<
if (phenomenonTime instanceof TimeInstant) {
newObservation.setResultTime((TimeInstant)phenomenonTime);
} else if (phenomenonTime instanceof TimePeriod) {
newObservation.setResultTime(new TimeInstant(((TimePeriod)phenomenonTime).getEnd()));
}
=======
if (phenomenonTime instanceof TimeInstant) {
newObservation.setResultTime((TimeInstant) phenomenonTime);
} else if (phenomenonTime instanceof TimePeriod) {
newObservation.setResultTime(new TimeInstant(((TimePeriod) phenomenonTime).getEnd()));
}
>>>>>>>
if (phenomenonTime instanceof TimeInstant) {
newObservation.setResultTime((TimeInstant) phenomenonTime);
} else if (phenomenonTime instanceof TimePeriod) {
newObservation.setResultTime(new TimeInstant(((TimePeriod) phenomenonTime).getEnd()));
} |
<<<<<<<
private static final int MAX_STEPS = 3;
private final VerticalLayout verticalLayout;
GridLayout grid;
private int step = 1;
private ElasticsearchClusterConfiguration elasticsearchClusterConfiguration = new ElasticsearchClusterConfiguration();
public Wizard() {
verticalLayout = new VerticalLayout();
verticalLayout.setSizeFull();
grid = new GridLayout(1, 1);
grid.setMargin(true);
grid.setSizeFull();
grid.addComponent(verticalLayout);
grid.setComponentAlignment(verticalLayout, Alignment.TOP_CENTER);
putForm();
}
private void putForm() {
verticalLayout.removeAllComponents();
switch (step) {
case 1: {
verticalLayout.addComponent(new StepStart(this));
break;
}
case 2: {
verticalLayout.addComponent(new ConfigurationStep(this));
break;
}
case 3: {
verticalLayout.addComponent(new VerificationStep(this));
break;
}
default: {
step = 1;
verticalLayout.addComponent(new StepStart(this));
break;
}
}
}
public Component getContent() {
return grid;
}
protected void next() {
step++;
putForm();
}
protected void back() {
step--;
putForm();
}
protected void cancel() {
step = 1;
putForm();
}
public ElasticsearchClusterConfiguration getElasticsearchClusterConfiguration() {
return elasticsearchClusterConfiguration;
}
public void init() {
step = 1;
elasticsearchClusterConfiguration = new ElasticsearchClusterConfiguration();
putForm();
}
=======
private static final int MAX_STEPS = 3;
private final VerticalLayout verticalLayout;
GridLayout grid;
private int step = 1;
private Config config = new Config();
private final ExecutorService executorService;
private final Tracker tracker;
private final Elasticsearch elasticsearch;
public Wizard( ExecutorService executorService, ServiceLocator serviceLocator ) throws NamingException {
this.elasticsearch = serviceLocator.getService( Elasticsearch.class );
this.executorService = executorService;
this.tracker = serviceLocator.getService( Tracker.class );
verticalLayout = new VerticalLayout();
verticalLayout.setSizeFull();
grid = new GridLayout( 1, 1 );
grid.setMargin( true );
grid.setSizeFull();
grid.addComponent( verticalLayout );
grid.setComponentAlignment( verticalLayout, Alignment.TOP_CENTER );
putForm();
}
private void putForm() {
verticalLayout.removeAllComponents();
switch ( step ) {
case 1: {
verticalLayout.addComponent( new StepStart( this ) );
break;
}
case 2: {
verticalLayout.addComponent( new ConfigurationStep( this ) );
break;
}
case 3: {
verticalLayout.addComponent( new VerificationStep( elasticsearch, executorService, tracker, this ) );
break;
}
default: {
step = 1;
verticalLayout.addComponent( new StepStart( this ) );
break;
}
}
}
public Component getContent() {
return grid;
}
protected void next() {
step++;
putForm();
}
protected void back() {
step--;
putForm();
}
protected void cancel() {
step = 1;
putForm();
}
public Config getConfig() {
return config;
}
>>>>>>>
private static final int MAX_STEPS = 3;
private final VerticalLayout verticalLayout;
GridLayout grid;
private int step = 1;
private ElasticsearchClusterConfiguration config = new ElasticsearchClusterConfiguration();
private final ExecutorService executorService;
private final Tracker tracker;
private final Elasticsearch elasticsearch;
public Wizard( ExecutorService executorService, ServiceLocator serviceLocator ) throws NamingException {
this.elasticsearch = serviceLocator.getService( Elasticsearch.class );
this.executorService = executorService;
this.tracker = serviceLocator.getService( Tracker.class );
verticalLayout = new VerticalLayout();
verticalLayout.setSizeFull();
grid = new GridLayout( 1, 1 );
grid.setMargin( true );
grid.setSizeFull();
grid.addComponent( verticalLayout );
grid.setComponentAlignment( verticalLayout, Alignment.TOP_CENTER );
putForm();
}
private void putForm() {
verticalLayout.removeAllComponents();
switch ( step ) {
case 1: {
verticalLayout.addComponent( new StepStart( this ) );
break;
}
case 2: {
verticalLayout.addComponent( new ConfigurationStep( this ) );
break;
}
case 3: {
verticalLayout.addComponent( new VerificationStep( elasticsearch, executorService, tracker, this ) );
break;
}
default: {
step = 1;
verticalLayout.addComponent( new StepStart( this ) );
break;
}
}
}
public Component getContent() {
return grid;
}
protected void next() {
step++;
putForm();
}
protected void back() {
step--;
putForm();
}
protected void cancel() {
step = 1;
putForm();
}
public ElasticsearchClusterConfiguration getConfig() {
return config;
} |
<<<<<<<
import org.safehaus.subutai.shared.operation.AbstractOperationHandler;
import org.safehaus.subutai.shared.protocol.Agent;
=======
import org.safehaus.subutai.common.protocol.AbstractOperationHandler;
import org.safehaus.subutai.common.tracker.ProductOperation;
import org.safehaus.subutai.common.protocol.Agent;
>>>>>>>
import org.safehaus.subutai.common.protocol.AbstractOperationHandler;
import org.safehaus.subutai.common.protocol.Agent; |
<<<<<<<
import io.subutai.common.security.crypto.pgp.KeyPair;
import io.subutai.common.settings.ChannelSettings;
=======
import io.subutai.common.protocol.N2NConfig;
>>>>>>>
import io.subutai.common.protocol.N2NConfig;
<<<<<<<
=======
import io.subutai.core.env.impl.tasks.SetContainerDomainTask;
import io.subutai.core.env.impl.tasks.SetDomainTask;
import io.subutai.core.env.impl.tasks.SetSshKeyTask;
>>>>>>>
import io.subutai.core.env.impl.tasks.SetContainerDomainTask;
import io.subutai.core.env.impl.tasks.SetDomainTask;
import io.subutai.core.env.impl.tasks.SetSshKeyTask;
<<<<<<<
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.cxf.jaxrs.client.WebClient;
import com.google.common.base.Preconditions;
import com.google.common.base.Strings;
import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
=======
>>>>>>> |
<<<<<<<
import org.safehaus.subutai.core.peer.impl.command.CommandResultImpl;
import org.safehaus.subutai.core.peer.impl.command.TempResponseConverter;
import org.safehaus.subutai.core.peer.impl.dao.ManagementHostDataService;
=======
>>>>>>>
import org.safehaus.subutai.core.peer.impl.command.CommandResultImpl;
import org.safehaus.subutai.core.peer.impl.command.TempResponseConverter;
import org.safehaus.subutai.core.peer.impl.dao.ManagementHostDataService;
<<<<<<<
private Map<UUID, List> peerEvents = new ConcurrentHashMap<>();
private ManagementHostDataService managementHostDataService;
=======
>>>>>>>
private Map<UUID, List> peerEvents = new ConcurrentHashMap<>();
private ManagementHostDataService managementHostDataService;
<<<<<<<
// this.managementHostDataService = managementHostDataService;
=======
this.commandExecutor = commandExecutor;
>>>>>>>
// this.managementHostDataService = managementHostDataService;
this.commandExecutor = commandExecutor; |
<<<<<<<
assertNull(patientInfo.getDateOfBirth());
List<String> renderedStrings = getRenderedStrings(patientInfo, "PID-7", 1);
=======
assertEquals(null, patientInfo.getDateOfBirth());
var renderedStrings = getRenderedStrings(patientInfo, "PID-7", 1);
>>>>>>>
assertNull(patientInfo.getDateOfBirth());
var renderedStrings = getRenderedStrings(patientInfo, "PID-7", 1);
<<<<<<<
assertNull(patientInfo.getGender());
List<String> renderedStrings = getRenderedStrings(patientInfo, "PID-8", 1);
=======
assertEquals(null, patientInfo.getGender());
var renderedStrings = getRenderedStrings(patientInfo, "PID-8", 1);
>>>>>>>
assertNull(patientInfo.getGender());
var renderedStrings = getRenderedStrings(patientInfo, "PID-8", 1); |
<<<<<<<
import org.safehaus.subutai.common.peer.PeerPolicy;
=======
import org.safehaus.subutai.common.security.SecurityProvider;
import org.safehaus.subutai.common.security.crypto.certificate.CertificateData;
import org.safehaus.subutai.common.security.crypto.certificate.CertificateManager;
import org.safehaus.subutai.common.security.crypto.key.KeyPairType;
import org.safehaus.subutai.common.security.crypto.keystore.KeyStoreData;
import org.safehaus.subutai.common.security.crypto.keystore.KeyStoreManager;
>>>>>>>
import org.safehaus.subutai.common.peer.PeerPolicy;
import org.safehaus.subutai.common.security.SecurityProvider;
import org.safehaus.subutai.common.security.crypto.certificate.CertificateData;
import org.safehaus.subutai.common.security.crypto.certificate.CertificateManager;
import org.safehaus.subutai.common.security.crypto.key.KeyPairType;
import org.safehaus.subutai.common.security.crypto.keystore.KeyStoreData;
import org.safehaus.subutai.common.security.crypto.keystore.KeyStoreManager; |
<<<<<<<
=======
>>>>>>>
<<<<<<<
public class Manager
{
=======
private static final Pattern elasticsearchPattern = Pattern.compile( ".*(elasticsearch.+?g).*" );
>>>>>>>
<<<<<<<
private GridLayout contentRoot;
private ComboBox clusterCombo;
private ElasticsearchClusterConfiguration config;
private static final String message = "No cluster is installed !";
private static final Embedded progressIcon = new Embedded( "", new ThemeResource( "img/spinner.gif" ) );
private static final Pattern elasticsearchPattern = Pattern.compile( ".*(elasticsearch.+?g).*" );
=======
private final String message = "No cluster is installed !";
private final Embedded progressIcon = new Embedded( "", new ThemeResource( "img/spinner.gif" ) );
>>>>>>>
private static final String message = "No cluster is installed !";
private static final Embedded progressIcon = new Embedded( "", new ThemeResource( "img/spinner.gif" ) );
private static final Pattern elasticsearchPattern = Pattern.compile( ".*(elasticsearch.+?g).*" );
<<<<<<<
public void itemClick( ItemClickEvent event )
{
if ( event.isDoubleClick() )
{
String lxcHostname =
( String ) table.getItem( event.getItemId() ).getItemProperty( HOST_COLUMN_CAPTION )
.getValue();
=======
public void itemClick( ItemClickEvent event )
{
if ( event.isDoubleClick() )
{
String lxcHostname =
( String ) table.getItem( event.getItemId() ).getItemProperty( "Host" ).getValue();
>>>>>>>
public void itemClick( ItemClickEvent event )
{
if ( event.isDoubleClick() )
{
String lxcHostname =
( String ) table.getItem( event.getItemId() ).getItemProperty( HOST_COLUMN_CAPTION )
.getValue();
<<<<<<<
public void refreshClustersInfo()
{
List<ElasticsearchClusterConfiguration> config = elasticsearch.getClusters();
ElasticsearchClusterConfiguration clusterInfo = ( ElasticsearchClusterConfiguration ) clusterCombo.getValue();
clusterCombo.removeAllItems();
if ( config == null || config.isEmpty() )
{
progressIcon.setVisible( false );
return;
}
for ( ElasticsearchClusterConfiguration esConfig : config )
{
clusterCombo.addItem( esConfig );
clusterCombo.setItemCaption( esConfig, esConfig.getClusterName() );
}
if ( clusterInfo != null )
{
for ( ElasticsearchClusterConfiguration esConfig : config )
{
if ( esConfig.getClusterName().equals( clusterInfo.getClusterName() ) )
{
clusterCombo.setValue( esConfig );
return;
}
}
}
else
{
clusterCombo.setValue( config.iterator().next() );
}
progressIcon.setVisible( false );
}
=======
>>>>>>>
public void refreshClustersInfo()
{
List<ElasticsearchClusterConfiguration> config = elasticsearch.getClusters();
ElasticsearchClusterConfiguration clusterInfo = ( ElasticsearchClusterConfiguration ) clusterCombo.getValue();
clusterCombo.removeAllItems();
if ( config == null || config.isEmpty() )
{
progressIcon.setVisible( false );
return;
}
for ( ElasticsearchClusterConfiguration esConfig : config )
{
clusterCombo.addItem( esConfig );
clusterCombo.setItemCaption( esConfig, esConfig.getClusterName() );
}
if ( clusterInfo != null )
{
for ( ElasticsearchClusterConfiguration esConfig : config )
{
if ( esConfig.getClusterName().equals( clusterInfo.getClusterName() ) )
{
clusterCombo.setValue( esConfig );
return;
}
}
}
else
{
clusterCombo.setValue( config.iterator().next() );
}
progressIcon.setVisible( false );
}
<<<<<<<
final Object rowId = table.addItem( new Object[] {
agent.getHostname(), agent.getListIP().get( 0 ), checkIfMaster( agent ), resultHolder,
availableOperations
=======
final Object rowId = table.addItem( new Object[] {
agent.getHostname(), parseIPList( agent.getListIP().toString() ), isMaster, checkButton,
startButton, stopButton, resultHolder
>>>>>>>
final Object rowId = table.addItem( new Object[] {
agent.getHostname(), agent.getListIP().get( 0 ), checkIfMaster( agent ), resultHolder,
availableOperations
<<<<<<<
public String checkIfMaster( Agent agent )
{
if ( config.getMasterNodes().contains( agent ) )
{
return "Master";
=======
public String checkIfMaster( Agent agent )
{
if ( config.getMasterNodes().contains( agent ) )
{
return "Master Node";
>>>>>>>
public String checkIfMaster( Agent agent )
{
if ( config.getMasterNodes().contains( agent ) )
{
return "Master";
<<<<<<<
public Component getContent()
{
=======
public void refreshClustersInfo()
{
List<ElasticsearchClusterConfiguration> elasticsearchClusterConfigurationList = elasticsearch.getClusters();
ElasticsearchClusterConfiguration clusterInfo = ( ElasticsearchClusterConfiguration ) clusterCombo.getValue();
clusterCombo.removeAllItems();
if ( elasticsearchClusterConfigurationList == null || elasticsearchClusterConfigurationList.isEmpty() )
{
return;
}
for ( ElasticsearchClusterConfiguration elasticsearchClusterConfiguration :
elasticsearchClusterConfigurationList )
{
clusterCombo.addItem( elasticsearchClusterConfiguration );
clusterCombo.setItemCaption( elasticsearchClusterConfiguration,
elasticsearchClusterConfiguration.getClusterName() );
}
if ( clusterInfo != null )
{
for ( ElasticsearchClusterConfiguration cassandraInfo : elasticsearchClusterConfigurationList )
{
if ( cassandraInfo.getClusterName().equals( clusterInfo.getClusterName() ) )
{
clusterCombo.setValue( cassandraInfo );
return;
}
}
}
else
{
clusterCombo.setValue( elasticsearchClusterConfigurationList.iterator().next() );
}
}
public Component getContent()
{
>>>>>>>
public Component getContent()
{ |
<<<<<<<
/** Blueprints *************************************************** */
@Override
public Response getBlueprints()
{
try
{
return Response.ok( gson.toJson( environmentManager.getBlueprints() ) ).build();
}
catch ( EnvironmentManagerException e )
{
return Response.status( Response.Status.BAD_REQUEST )
.entity( JsonUtil.toJson( ERROR_KEY, "Error loading blueprints" ) ).build();
}
}
@Override
public Response getBlueprint( UUID blueprintId )
{
try
{
Blueprint blueprint = environmentManager.getBlueprint( blueprintId );
if ( blueprint != null )
{
return Response.ok( gson.toJson( blueprint ) ).build();
}
else
{
return Response.status( Response.Status.NOT_FOUND ).build();
}
}
catch ( EnvironmentManagerException e )
{
return Response.status( Response.Status.BAD_REQUEST )
.entity( JsonUtil.toJson( ERROR_KEY, "Error blueprint not found" ) ).build();
}
}
@Override
public Response saveBlueprint( final String content )
{
try
{
Blueprint blueprint = gson.fromJson( content, Blueprint.class );
//
// for ( NodeGroup nodeGroup : blueprint.getNodeGroups() )
// {
// if ( nodeGroup.getNumberOfContainers() <= 0 )
// {
// return Response.status( Response.Status.BAD_REQUEST )
// .entity( JsonUtil.toJson( ERROR_KEY, "You must specify at least 1
// container" ) )
// .build();
// }
// }
if ( blueprint.getId() == null )
{
blueprint.setId( UUID.randomUUID() );
}
environmentManager.saveBlueprint( blueprint );
return Response.ok( gson.toJson( blueprint ) ).build();
}
catch ( Exception e )
{
LOG.error( "Error validating blueprint", e );
return Response.status( Response.Status.BAD_REQUEST ).entity( JsonUtil.toJson( ERROR_KEY, e.getMessage() ) )
.build();
}
}
@Override
public Response deleteBlueprint( final UUID blueprintId )
{
try
{
environmentManager.removeBlueprint( blueprintId );
return Response.ok().build();
}
catch ( EnvironmentManagerException e )
{
return Response.status( Response.Status.BAD_REQUEST )
.entity( JsonUtil.toJson( ERROR_KEY, "Error deleting blueprint " + blueprintId ) ).build();
}
}
=======
>>>>>>>
<<<<<<<
// updateContainerPlacementStrategy( blueprint );
=======
>>>>>>>
<<<<<<<
try
{
Blueprint blueprint = gson.fromJson( blueprintJson, Blueprint.class );
// updateContainerPlacementStrategy( blueprint );
Set<EnvironmentContainerHost> environment =
environmentManager.growEnvironment( environmentId, blueprint, false );
}
catch ( Exception e )
{
LOG.error( "Error validating parameters #growEnvironment", e );
return Response.status( Response.Status.BAD_REQUEST ).entity( JsonUtil.toJson( ERROR_KEY, e.getMessage() ) )
.build();
}
=======
// try
// {
// Blueprint blueprint = gson.fromJson( blueprintJson, Blueprint.class );
//
// // updateContainerPlacementStrategy( blueprint );
//
// Set<EnvironmentContainerHost> environment =
// environmentManager.growEnvironment( environmentId, blueprint, false );
// }
// catch ( Exception e )
// {
// LOG.error( "Error validating parameters #growEnvironment", e );
// return Response.status( Response.Status.BAD_REQUEST ).entity( JsonUtil.toJson( ERROR_KEY, e
// .getMessage() ) )
// .build();
// }
>>>>>>>
// try
// {
// Blueprint blueprint = gson.fromJson( blueprintJson, Blueprint.class );
//
// // updateContainerPlacementStrategy( blueprint );
//
// Set<EnvironmentContainerHost> environment =
// environmentManager.growEnvironment( environmentId, blueprint, false );
// }
// catch ( Exception e )
// {
// LOG.error( "Error validating parameters #growEnvironment", e );
// return Response.status( Response.Status.BAD_REQUEST ).entity( JsonUtil.toJson( ERROR_KEY, e
// .getMessage() ) )
// .build();
// }
<<<<<<<
// @Override
public Response createEnvironment( final String blueprintJson )
{
try
{
Blueprint blueprint = gson.fromJson( blueprintJson, Blueprint.class );
// updateContainerPlacementStrategy( blueprint );
Environment environment = environmentManager.createEnvironment( blueprint, false );
}
catch ( EnvironmentCreationException e )
{
LOG.error( "Error creating environment #createEnvironment", e );
return Response.serverError().entity( JsonUtil.toJson( ERROR_KEY, e.getMessage() ) ).build();
}
catch ( JsonParseException e )
{
LOG.error( "Error validating parameters #createEnvironment", e );
return Response.status( Response.Status.BAD_REQUEST ).entity( JsonUtil.toJson( ERROR_KEY, e.getMessage() ) )
.build();
}
return Response.ok().build();
}
=======
>>>>>>> |
<<<<<<<
createContainer( resourceHost, creatorPeerId, environmentId, templates, cloneName );
containerHost.setNodeGroupName( nodeGroupName );
=======
resourceHost.createContainer( creatorPeerId, environmentId, templates, cloneName );
>>>>>>>
createContainer( resourceHost, creatorPeerId, environmentId, templates, cloneName );
containerHost.setNodeGroupName( nodeGroupName );
resourceHost.createContainer( creatorPeerId, environmentId, templates, cloneName ); |
<<<<<<<
/**
* Camel context-based constructor.
*
* @param camelContext camel context
*/
=======
>>>>>>>
/**
* Camel context-based constructor.
*
* @param camelContext camel context
*/ |
<<<<<<<
import io.subutai.common.environment.Blueprint;
=======
>>>>>>> |
<<<<<<<
=======
import io.subutai.core.hubmanager.api.RestResult;
import io.subutai.core.hubmanager.impl.processor.port_map.DestroyPortMap;
>>>>>>>
import io.subutai.core.hubmanager.api.RestResult;
import io.subutai.core.hubmanager.impl.processor.port_map.DestroyPortMap;
<<<<<<<
import io.subutai.core.identity.api.model.UserToken;
=======
import io.subutai.hub.share.dto.domain.ContainerPortMapDto;
import io.subutai.hub.share.dto.domain.PortMapDto;
>>>>>>>
import io.subutai.hub.share.dto.domain.ContainerPortMapDto;
import io.subutai.hub.share.dto.domain.PortMapDto;
import io.subutai.core.identity.api.model.UserToken; |
<<<<<<<
private static final String NEWLINE = "\n";
private HexUtil()
{
}
/**
* ***********************************************************************
*/
public static byte[] hexStringToByteArray( String s )
{
byte[] b = new byte[s.length() / 2];
for ( int i = 0; i < b.length; i++ )
{
int index = i * 2;
int v = Integer.parseInt( s.substring( index, index + 2 ), 16 );
b[i] = ( byte ) v;
}
return b;
}
/**
* ***********************************************************************
*/
public static String byteArrayToHexString( byte[] b )
{
StringBuilder sb = new StringBuilder( b.length * 2 );
for ( final byte aB : b )
{
int v = aB & 0xff;
if ( v < 16 )
{
sb.append( '0' );
}
sb.append( Integer.toHexString( v ) );
}
return sb.toString().toUpperCase();
}
/**
* ************************************************************************* Get hex string for the supplied big
* integer: "0x<hex string>" where hex string is outputted in groups of exactly four characters sub-divided by
* spaces.
*
* @param bigInt Big integer
*
* @return Hex string
*/
public static String getHexString( BigInteger bigInt )
{
// Convert number to hex string
String hex = bigInt.toString( 16 ).toUpperCase();
// Get number padding bytes
int padding = ( 4 - ( hex.length() % 4 ) );
// Insert any required padding to get groups of exactly 4 characters
if ( ( padding > 0 ) && ( padding < 4 ) )
{
StringBuilder sb = new StringBuilder( hex );
for ( int i = 0; i < padding; i++ )
{
sb.insert( 0, '0' );
}
hex = sb.toString();
}
// Output with leading "0x" and spaces to form groups
StringBuilder strBuff = new StringBuilder();
strBuff.append( "0x" );
for ( int i = 0; i < hex.length(); i++ )
{
strBuff.append( hex.charAt( i ) );
if ( ( ( ( i + 1 ) % 4 ) == 0 ) && ( ( i + 1 ) != hex.length() ) )
{
strBuff.append( ' ' );
}
}
return strBuff.toString();
}
/**
* Get hex string for the supplied byte array: "0x<hex string>" where hex string is outputted in groups of exactly
* four characters sub-divided by spaces.
*
* @param bytes Byte array
*
* @return Hex string
*/
public static String getHexString( byte[] bytes )
{
return getHexString( new BigInteger( 1, bytes ) );
}
/**
* Get hex and clear text dump of byte array.
*
* @param bytes Array of bytes
*
* @return Hex/clear dump
*
* @throws IOException If an I/O problem occurs
*/
public static String getHexClearDump( byte[] bytes ) throws IOException
{
ByteArrayInputStream bais = null;
try
{
// Divide dump into 8 byte lines
StringBuilder strBuff = new StringBuilder();
bais = new ByteArrayInputStream( bytes );
byte[] line = new byte[8];
int read = -1;
boolean firstLine = true;
while ( ( read = bais.read( line ) ) != -1 )
{
if ( firstLine )
{
firstLine = false;
}
else
{
strBuff.append( NEWLINE );
}
strBuff.append( getHexClearLineDump( line, read ) );
}
return strBuff.toString();
}
finally
{
SafeCloseUtil.close( bais );
}
}
private static String getHexClearLineDump( byte[] bytes, int len )
{
StringBuilder sbHex = new StringBuilder();
StringBuilder sbClr = new StringBuilder();
for ( int cnt = 0; cnt < len; cnt++ )
{
// Convert byte to int
byte b = bytes[cnt];
int i = b & 0xFF;
// First part of byte will be one hex char
int i1 = ( int ) Math.floor( i / ( double ) 16 );
// Second part of byte will be one hex char
int i2 = i % 16;
// Get hex characters
sbHex.append( Character.toUpperCase( Character.forDigit( i1, 16 ) ) );
sbHex.append( Character.toUpperCase( Character.forDigit( i2, 16 ) ) );
if ( ( cnt + 1 ) < len )
{
// Divider between hex characters
sbHex.append( ' ' );
}
// Get clear character
// Character to display if character not defined in Unicode or is a
// control charcter
char c = '.';
// Not a control character and defined in Unicode
if ( ( !Character.isISOControl( ( char ) i ) ) && ( Character.isDefined( ( char ) i ) ) )
{
c = ( char ) i;
}
sbClr.append( c );
}
=======
private static final String NEWLINE = "\n";
private HexUtil()
{
}
/**
* Convert hexadecimal string to array of bytes
*
* @param s String
* @return byte[]
*/
public static byte[] hexStringToByteArray(String s)
{
byte[] b = new byte[s.length() / 2];
for (int i = 0; i < b.length; i++)
{
int index = i * 2;
int v = Integer.parseInt(s.substring(index, index + 2), 16);
b[i] = (byte) v;
}
return b;
}
/**
* Convert array of bytes to hexadecimal string
*
* @param b byte[]
* @return String
*/
public static String byteArrayToHexString(byte[] b)
{
StringBuffer sb = new StringBuffer(b.length * 2);
for (int i = 0; i < b.length; i++)
{
int v = b[i] & 0xff;
if (v < 16)
{
sb.append('0');
}
sb.append(Integer.toHexString(v));
}
return sb.toString().toUpperCase();
}
/****************************************************************************
* Get hex string for the supplied big integer: "0x<hex string>" where hex
* string is outputted in groups of exactly four characters sub-divided by
* spaces.
*
* @param bigInt
* Big integer
* @return Hex string
*/
public static String getHexString( BigInteger bigInt )
{
// Convert number to hex string
String hex = bigInt.toString( 16 ).toUpperCase();
// Get number padding bytes
int padding = ( 4 - ( hex.length() % 4 ) );
// Insert any required padding to get groups of exactly 4 characters
if ( ( padding > 0 ) && ( padding < 4 ) )
{
StringBuffer sb = new StringBuffer( hex );
for ( int i = 0; i < padding; i++ )
{
sb.insert( 0, '0' );
}
hex = sb.toString();
}
// Output with leading "0x" and spaces to form groups
StringBuffer strBuff = new StringBuffer();
strBuff.append( "0x" );
for ( int i = 0; i < hex.length(); i++ )
{
strBuff.append( hex.charAt( i ) );
if ( ( ( ( i + 1 ) % 4 ) == 0 ) && ( ( i + 1 ) != hex.length() ) )
{
strBuff.append( ' ' );
}
}
return strBuff.toString();
}
/**
* Get hex string for the supplied byte array: "0x<hex string>" where hex
* string is outputted in groups of exactly four characters sub-divided by
* spaces.
*
* @param bytes
* Byte array
* @return Hex string
*/
public static String getHexString( byte[] bytes )
{
return getHexString( new BigInteger( 1, bytes ) );
}
/**
* Get hex and clear text dump of byte array.
*
* @param bytes
* Array of bytes
* @return Hex/clear dump
* @throws IOException
* If an I/O problem occurs
*/
public static String getHexClearDump( byte[] bytes ) throws IOException
{
ByteArrayInputStream bais = null;
try
{
// Divide dump into 8 byte lines
StringBuffer strBuff = new StringBuffer();
bais = new ByteArrayInputStream( bytes );
byte[] line = new byte[8];
int read = -1;
boolean firstLine = true;
while ( ( read = bais.read( line ) ) != -1 )
{
if ( firstLine )
{
firstLine = false;
}
else
{
strBuff.append( NEWLINE );
}
strBuff.append( getHexClearLineDump( line, read ) );
}
return strBuff.toString();
}
finally
{
SafeCloseUtil.close( bais );
}
}
private static String getHexClearLineDump( byte[] bytes, int len )
{
StringBuffer sbHex = new StringBuffer();
StringBuffer sbClr = new StringBuffer();
for ( int cnt = 0; cnt < len; cnt++ )
{
// Convert byte to int
byte b = bytes[cnt];
int i = b & 0xFF;
// First part of byte will be one hex char
int i1 = (int) Math.floor( i / 16 );
// Second part of byte will be one hex char
int i2 = i % 16;
// Get hex characters
sbHex.append( Character.toUpperCase( Character.forDigit( i1, 16 ) ) );
sbHex.append( Character.toUpperCase( Character.forDigit( i2, 16 ) ) );
if ( ( cnt + 1 ) < len )
{
// Divider between hex characters
sbHex.append( ' ' );
}
// Get clear character
// Character to display if character not defined in Unicode or is a
// control charcter
char c = '.';
// Not a control character and defined in Unicode
if ( ( !Character.isISOControl( (char) i ) )
&& ( Character.isDefined( (char) i ) ) )
{
Character clr = new Character( (char) i );
c = clr.charValue();
}
sbClr.append( c );
}
>>>>>>>
private static final String NEWLINE = "\n";
private HexUtil()
{
}
/**
* Convert hexadecimal string to array of bytes
*
* @param s String
* @return byte[]
*/
public static byte[] hexStringToByteArray(String s)
{
byte[] b = new byte[s.length() / 2];
for (int i = 0; i < b.length; i++)
{
int index = i * 2;
int v = Integer.parseInt(s.substring(index, index + 2), 16);
b[i] = (byte) v;
}
return b;
}
/**
* Convert array of bytes to hexadecimal string
*
* @param b byte[]
* @return String
*/
public static String byteArrayToHexString(byte[] b)
{
StringBuilder sb = new StringBuilder( b.length * 2 );
for ( final byte aB : b )
{
int v = aB & 0xff;
if ( v < 16 )
{
sb.append( '0' );
}
sb.append( Integer.toHexString( v ) );
}
return sb.toString().toUpperCase();
}
/****************************************************************************
* Get hex string for the supplied big integer: "0x<hex string>" where hex
* string is outputted in groups of exactly four characters sub-divided by
* spaces.
*
* @param bigInt
* Big integer
* @return Hex string
*/
public static String getHexString( BigInteger bigInt )
{
// Convert number to hex string
String hex = bigInt.toString( 16 ).toUpperCase();
// Get number padding bytes
int padding = ( 4 - ( hex.length() % 4 ) );
// Insert any required padding to get groups of exactly 4 characters
if ( ( padding > 0 ) && ( padding < 4 ) )
{
StringBuilder sb = new StringBuilder( hex );
for ( int i = 0; i < padding; i++ )
{
sb.insert( 0, '0' );
}
hex = sb.toString();
}
// Output with leading "0x" and spaces to form groups
StringBuilder strBuff = new StringBuilder();
strBuff.append( "0x" );
for ( int i = 0; i < hex.length(); i++ )
{
strBuff.append( hex.charAt( i ) );
if ( ( ( ( i + 1 ) % 4 ) == 0 ) && ( ( i + 1 ) != hex.length() ) )
{
strBuff.append( ' ' );
}
}
return strBuff.toString();
}
/**
* Get hex string for the supplied byte array: "0x<hex string>" where hex
* string is outputted in groups of exactly four characters sub-divided by
* spaces.
*
* @param bytes
* Byte array
* @return Hex string
*/
public static String getHexString( byte[] bytes )
{
return getHexString( new BigInteger( 1, bytes ) );
}
/**
* Get hex and clear text dump of byte array.
*
* @param bytes
* Array of bytes
* @return Hex/clear dump
* @throws IOException
* If an I/O problem occurs
*/
public static String getHexClearDump( byte[] bytes ) throws IOException
{
ByteArrayInputStream bais = null;
try
{
// Divide dump into 8 byte lines
StringBuilder strBuff = new StringBuilder();
bais = new ByteArrayInputStream( bytes );
byte[] line = new byte[8];
int read = -1;
boolean firstLine = true;
while ( ( read = bais.read( line ) ) != -1 )
{
if ( firstLine )
{
firstLine = false;
}
else
{
strBuff.append( NEWLINE );
}
strBuff.append( getHexClearLineDump( line, read ) );
}
return strBuff.toString();
}
finally
{
SafeCloseUtil.close( bais );
}
}
private static String getHexClearLineDump( byte[] bytes, int len )
{
StringBuilder sbHex = new StringBuilder();
StringBuilder sbClr = new StringBuilder();
for ( int cnt = 0; cnt < len; cnt++ )
{
// Convert byte to int
byte b = bytes[cnt];
int i = b & 0xFF;
// First part of byte will be one hex char
int i1 = ( int ) Math.floor( i / ( double ) 16 );
// Second part of byte will be one hex char
int i2 = i % 16;
// Get hex characters
sbHex.append( Character.toUpperCase( Character.forDigit( i1, 16 ) ) );
sbHex.append( Character.toUpperCase( Character.forDigit( i2, 16 ) ) );
if ( ( cnt + 1 ) < len )
{
// Divider between hex characters
sbHex.append( ' ' );
}
// Get clear character
// Character to display if character not defined in Unicode or is a
// control charcter
char c = '.';
// Not a control character and defined in Unicode
if ( ( !Character.isISOControl( (char) i ) )
&& ( Character.isDefined( (char) i ) ) )
{
Character clr = new Character( (char) i );
c = clr.charValue();
}
sbClr.append( c );
} |
<<<<<<<
import io.subutai.common.command.CommandException;
import io.subutai.common.command.CommandResult;
import io.subutai.common.command.RequestBuilder;
import io.subutai.common.environment.Environment;
=======
>>>>>>>
import io.subutai.common.environment.Environment; |
<<<<<<<
=======
import java.io.Serializable;
import javax.activation.DataHandler;
import javax.xml.bind.annotation.*;
>>>>>>>
import java.io.Serializable;
<<<<<<<
public class Document extends ContentMap implements Serializable {
=======
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "Document")
@XmlRootElement(name = "document")
public class Document implements Serializable {
>>>>>>>
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "Document")
@XmlRootElement(name = "document")
public class Document extends ContentMap implements Serializable { |
<<<<<<<
private IdentityManager identityManager;
private RelationManager relationManager;
protected boolean initialized = false;
protected ExecutorService singleThreadExecutorService = SubutaiExecutors.newSingleThreadExecutor();
=======
protected volatile boolean initialized = false;
>>>>>>>
private IdentityManager identityManager;
private RelationManager relationManager;
protected boolean initialized = false;
<<<<<<<
public void setIdentityManager( final IdentityManager identityManager )
{
this.identityManager = identityManager;
}
public void setRelationManager( final RelationManager relationManager )
{
this.relationManager = relationManager;
}
public void init() throws PeerException
=======
public void init()
>>>>>>>
public void setIdentityManager( final IdentityManager identityManager )
{
this.identityManager = identityManager;
}
public void setRelationManager( final RelationManager relationManager )
{
this.relationManager = relationManager;
}
public void init() |
<<<<<<<
import com.google.common.cache.Cache;
=======
import com.google.common.base.Preconditions;
import com.google.common.base.Strings;
>>>>>>>
import com.google.common.cache.Cache;
import com.google.common.base.Preconditions;
import com.google.common.base.Strings;
<<<<<<<
@Override
public Agent waitForAgent( final String containerName, final int timeout )
{
return agentManager.waitForRegistration( containerName, timeout );
}
=======
@Override
public <T, V> V sendRequest( final T payload, final String recipient, final int timeout,
final Class<V> responseType ) throws PeerException
{
Preconditions.checkNotNull( payload, "Invalid payload" );
Preconditions.checkArgument( !Strings.isNullOrEmpty( recipient ), "Invalid recipient" );
Preconditions.checkArgument( timeout > 0, "Timeout must be greater than 0" );
Preconditions.checkNotNull( responseType, "Invalid response type" );
for ( RequestListener requestListener : requestListeners )
{
if ( recipient.equalsIgnoreCase( requestListener.getRecipient() ) )
{
try
{
Object response = requestListener.onRequest( payload );
return responseType.cast( response );
}
catch ( Exception e )
{
throw new PeerException( e );
}
}
}
return null;
}
>>>>>>>
@Override
public <T, V> V sendRequest( final T payload, final String recipient, final int timeout,
final Class<V> responseType ) throws PeerException
{
Preconditions.checkNotNull( payload, "Invalid payload" );
Preconditions.checkArgument( !Strings.isNullOrEmpty( recipient ), "Invalid recipient" );
Preconditions.checkArgument( timeout > 0, "Timeout must be greater than 0" );
Preconditions.checkNotNull( responseType, "Invalid response type" );
for ( RequestListener requestListener : requestListeners )
{
if ( recipient.equalsIgnoreCase( requestListener.getRecipient() ) )
{
try
{
Object response = requestListener.onRequest( payload );
return responseType.cast( response );
}
catch ( Exception e )
{
throw new PeerException( e );
}
}
}
return null;
}
@Override
public Agent waitForAgent( final String containerName, final int timeout )
{
return agentManager.waitForRegistration( containerName, timeout );
} |
<<<<<<<
=======
public void setConfigServers( Set<MongoConfigNode> configServers )
{
this.configServers.clear();
for ( final MongoConfigNode configServer : configServers )
{
this.configServers.add( ( MongoConfigNodeImpl ) configServer );
}
// this.configServers.addAll( configServers );
}
@Override
>>>>>>> |
<<<<<<<
@Column( name = "isApproved" )
private boolean isApproved = false; //requires admin approval
=======
@Column( name = "fingerprint" )
private String fingerprint = ""; // User key fingerprint
>>>>>>>
@Column( name = "isApproved" )
private boolean isApproved = false; //requires admin approval
@Column( name = "fingerprint" )
private String fingerprint = ""; // User key fingerprint |
<<<<<<<
import java.io.InputStream;
import javax.ws.rs.core.Response;
import org.bouncycastle.openpgp.PGPPublicKey;
=======
>>>>>>>
import java.io.InputStream;
import javax.ws.rs.core.Response;
import org.bouncycastle.openpgp.PGPPublicKey;
<<<<<<<
/* ******************************
*
*/
@Override
public Response addPublicKey( final String hostId,final String keyText )
{
securityManager.getKeyManager().savePublicKey(hostId,keyText);
return Response.ok().build();
}
/* ******************************
*
*/
@Override
public Response addSecurityKey( final String hostId,final String keyText, short keyType)
{
securityManager.getKeyManager().savePublicKey(hostId,keyText);
return Response.ok().build();
}
/* ******************************
*
*/
@Override
public Response removePublicKey( final String hostId )
{
securityManager.getKeyManager().removePublicKey( hostId );
return Response.ok().build();
}
/* ******************************
*
*/
@Override
public Response getPublicKey( final String hostId )
{
String key = securityManager.getKeyManager().getPublicKeyAsASCII( hostId);
if ( Strings.isNullOrEmpty( key ) )
{
return Response.status( Response.Status.NOT_FOUND ).entity( "Object Not found" ).build();
}
else
{
return Response.ok( key).build();
}
}
=======
>>>>>>>
/* ******************************
*
*/
@Override
public Response addPublicKey( final String hostId,final String keyText )
{
securityManager.getKeyManager().savePublicKey(hostId,keyText);
return Response.ok().build();
}
/* ******************************
*
*/
@Override
public Response addSecurityKey( final String hostId,final String keyText, short keyType)
{
securityManager.getKeyManager().savePublicKey(hostId,keyText);
return Response.ok().build();
}
/* ******************************
*
*/
@Override
public Response removePublicKey( final String hostId )
{
securityManager.getKeyManager().removePublicKey( hostId );
return Response.ok().build();
}
/* ******************************
*
*/
@Override
public Response getPublicKey( final String hostId )
{
String key = securityManager.getKeyManager().getPublicKeyAsASCII( hostId);
if ( Strings.isNullOrEmpty( key ) )
{
return Response.status( Response.Status.NOT_FOUND ).entity( "Object Not found" ).build();
}
else
{
return Response.ok( key).build();
}
} |
<<<<<<<
import org.safehaus.subutai.plugin.common.PluginDAO;
import org.safehaus.subutai.plugin.common.api.NodeType;
import org.safehaus.subutai.plugin.common.api.OperationType;
=======
import org.safehaus.subutai.plugin.common.api.ClusterOperationType;
import org.safehaus.subutai.plugin.common.api.NodeOperationType;
>>>>>>>
import org.safehaus.subutai.plugin.common.PluginDAO;
import org.safehaus.subutai.plugin.common.api.NodeType;
import org.safehaus.subutai.plugin.common.api.ClusterOperationType;
import org.safehaus.subutai.plugin.common.api.NodeOperationType;
<<<<<<<
new NodeOperationHandler( this, hadoopClusterConfig.getClusterName(), hostname, OperationType.START,
NodeType.DATANODE );
=======
new NodeOperationHandler( this, hadoopClusterConfig.getClusterName(), agent.getHostname(),
NodeOperationType.START, NodeType.DATANODE );
>>>>>>>
new NodeOperationHandler( this, hadoopClusterConfig.getClusterName(), hostname, NodeOperationType.START,
NodeType.DATANODE );
<<<<<<<
new NodeOperationHandler( this, hadoopClusterConfig.getClusterName(), hostname, OperationType.STATUS,
NodeType.DATANODE );
=======
new NodeOperationHandler( this, hadoopClusterConfig.getClusterName(), agent.getHostname(),
NodeOperationType.STATUS, NodeType.DATANODE );
>>>>>>>
new NodeOperationHandler( this, hadoopClusterConfig.getClusterName(), hostname, NodeOperationType.STATUS,
NodeType.DATANODE );
<<<<<<<
new NodeOperationHandler( this, hadoopClusterConfig.getClusterName(), hostname, OperationType.START,
NodeType.TASKTRACKER );
=======
new NodeOperationHandler( this, hadoopClusterConfig.getClusterName(), agent.getHostname(),
NodeOperationType.START, NodeType.TASKTRACKER );
>>>>>>>
new NodeOperationHandler( this, hadoopClusterConfig.getClusterName(), hostname, NodeOperationType.START,
NodeType.TASKTRACKER );
<<<<<<<
new NodeOperationHandler( this, hadoopClusterConfig.getClusterName(), hostname, OperationType.STOP,
NodeType.TASKTRACKER );
=======
new NodeOperationHandler( this, hadoopClusterConfig.getClusterName(), agent.getHostname(),
NodeOperationType.STOP, NodeType.TASKTRACKER );
>>>>>>>
new NodeOperationHandler( this, hadoopClusterConfig.getClusterName(), hostname, NodeOperationType.STOP,
NodeType.TASKTRACKER );
<<<<<<<
new NodeOperationHandler( this, hadoopClusterConfig.getClusterName(), hostname, OperationType.STATUS,
NodeType.TASKTRACKER );
=======
new NodeOperationHandler( this, hadoopClusterConfig.getClusterName(), agent.getHostname(),
NodeOperationType.STATUS, NodeType.TASKTRACKER );
>>>>>>>
new NodeOperationHandler( this, hadoopClusterConfig.getClusterName(), hostname, NodeOperationType.STATUS,
NodeType.TASKTRACKER );
<<<<<<<
new NodeOperationHandler( this, hadoopClusterConfig.getClusterName(), hostname, OperationType.EXCLUDE,
NodeType.SLAVE_NODE );
=======
new NodeOperationHandler( this, hadoopClusterConfig.getClusterName(), agent.getHostname(),
NodeOperationType.EXCLUDE, NodeType.SLAVE_NODE );
>>>>>>>
new NodeOperationHandler( this, hadoopClusterConfig.getClusterName(), hostname, NodeOperationType.EXCLUDE,
NodeType.SLAVE_NODE );
<<<<<<<
new NodeOperationHandler( this, hadoopClusterConfig.getClusterName(), hostname, OperationType.INCLUDE,
NodeType.SLAVE_NODE );
=======
new NodeOperationHandler( this, hadoopClusterConfig.getClusterName(), agent.getHostname(),
NodeOperationType.INCLUDE, NodeType.SLAVE_NODE );
>>>>>>>
new NodeOperationHandler( this, hadoopClusterConfig.getClusterName(), hostname, NodeOperationType.INCLUDE,
NodeType.SLAVE_NODE ); |
<<<<<<<
=======
import java.util.HashMap;
import java.util.Iterator;
>>>>>>>
<<<<<<<
createDefaultUsers();
=======
//*******Start Token Cleaner *****************
executorService.scheduleWithFixedDelay( new Runnable()
{
@Override
public void run()
{
try
{
removeInvalidTokens();
invalidateSessions();
}
catch ( Exception e )
{
LOGGER.error( "Error in cleanup task", e );
}
}
}, 10, 10, TimeUnit.MINUTES );
//*****************************************
>>>>>>>
createDefaultUsers();
<<<<<<<
=======
//**************************************
extendTokenTime( userToken, SESSION_TIMEOUT );
//**************************************
>>>>>>> |
<<<<<<<
import java.util.Collections;
=======
>>>>>>>
<<<<<<<
@Override
public UUID installCluster( PrestoClusterConfig config, HadoopClusterConfig hadoopConfig )
{
InstallOperationHandler h = new InstallOperationHandler( this, config );
h.setHadoopConfig( hadoopConfig );
executor.execute( h );
return h.getTrackerId();
}
=======
>>>>>>>
@Override
public UUID installCluster( PrestoClusterConfig config, HadoopClusterConfig hadoopConfig )
{
InstallOperationHandler h = new InstallOperationHandler( this, config );
h.setHadoopConfig( hadoopConfig );
executor.execute( h );
return h.getTrackerId();
} |
<<<<<<<
private final String[] bindHost;
private final String[] publishHost;
private final String username;
private final String password;
private final Boolean resolveConflicts;
private final Boolean wrapCounters;
private final Boolean ignoreFailures;
=======
private final String bindHost;
private final String publishHost;
>>>>>>>
private final String[] bindHost;
private final String[] publishHost;
<<<<<<<
this.checkpointDocumentType = settings.get("couchbase.typeSelector.checkpointDocumentType", DEFAULT_DOCUMENT_TYPE_CHECKPOINT);
this.dynamicTypePath = settings.get("couchbase.dynamicTypePath");
this.resolveConflicts = settings.getAsBoolean("couchbase.resolveConflicts", true);
this.wrapCounters = settings.getAsBoolean("couchbase.wrapCounters", false);
this.maxConcurrentRequests = settings.getAsLong("couchbase.maxConcurrentRequests", 1024L);
this.bulkIndexRetries = settings.getAsLong("couchbase.bulkIndexRetries", 1024L);
this.bulkIndexRetryWaitMs = settings.getAsLong("couchbase.bulkIndexRetryWaitMs", 1000L);
=======
>>>>>>>
<<<<<<<
Class<? extends TypeSelector> typeSelectorClass = DefaultTypeSelector.class;
=======
int defaultNumVbuckets = 1024;
if(System.getProperty("os.name").toLowerCase().contains("mac")) {
logger.info("Detected platform is Mac, changing default num_vbuckets to 64");
defaultNumVbuckets = 64;
}
this.numVbuckets = settings.getAsInt("couchbase.num_vbuckets", defaultNumVbuckets);
pluginSettings = new PluginSettings();
pluginSettings.setCheckpointDocumentType(settings.get("couchbase.typeSelector.checkpointDocumentType", PluginSettings.DEFAULT_DOCUMENT_TYPE_CHECKPOINT));
pluginSettings.setDynamicTypePath(settings.get("couchbase.dynamicTypePath"));
pluginSettings.setResolveConflicts(settings.getAsBoolean("couchbase.resolveConflicts", true));
pluginSettings.setWrapCounters(settings.getAsBoolean("couchbase.wrapCounters", false));
pluginSettings.setMaxConcurrentRequests(settings.getAsLong("couchbase.maxConcurrentRequests", 1024L));
pluginSettings.setBulkIndexRetries(settings.getAsLong("couchbase.bulkIndexRetries", 10L));
pluginSettings.setBulkIndexRetryWaitMs(settings.getAsLong("couchbase.bulkIndexRetryWaitMs", 1000L));
pluginSettings.setIgnoreDeletes(new ArrayList<String>(Arrays.asList(settings.get("couchbase.ignoreDeletes","").split("[:,;\\s]"))));
pluginSettings.getIgnoreDeletes().removeAll(Arrays.asList("", null));
pluginSettings.setIgnoreFailures(settings.getAsBoolean("couchbase.ignoreFailures", false));
pluginSettings.setDocumentTypeRoutingFields(settings.getByPrefix("couchbase.documentTypeRoutingFields.").getAsMap());
pluginSettings.setIgnoreDotIndexes(settings.getAsBoolean("couchbase.ignoreDotIndexes", true));
pluginSettings.setIncludeIndexes(new ArrayList<String>(Arrays.asList(settings.get("couchbase.includeIndexes", "").split("[:,;\\s]"))));
pluginSettings.getIncludeIndexes().removeAll(Arrays.asList("", null));
TypeSelector typeSelector;
Class<? extends TypeSelector> typeSelectorClass = settings.<TypeSelector>getAsClass("couchbase.typeSelector", DefaultTypeSelector.class);
>>>>>>>
int defaultNumVbuckets = 1024;
if(System.getProperty("os.name").toLowerCase().contains("mac")) {
logger.info("Detected platform is Mac, changing default num_vbuckets to 64");
defaultNumVbuckets = 64;
}
this.numVbuckets = settings.getAsInt("couchbase.num_vbuckets", defaultNumVbuckets);
pluginSettings = new PluginSettings();
pluginSettings.setCheckpointDocumentType(settings.get("couchbase.typeSelector.checkpointDocumentType", PluginSettings.DEFAULT_DOCUMENT_TYPE_CHECKPOINT));
pluginSettings.setDynamicTypePath(settings.get("couchbase.dynamicTypePath"));
pluginSettings.setResolveConflicts(settings.getAsBoolean("couchbase.resolveConflicts", true));
pluginSettings.setWrapCounters(settings.getAsBoolean("couchbase.wrapCounters", false));
pluginSettings.setMaxConcurrentRequests(settings.getAsLong("couchbase.maxConcurrentRequests", 1024L));
pluginSettings.setBulkIndexRetries(settings.getAsLong("couchbase.bulkIndexRetries", 10L));
pluginSettings.setBulkIndexRetryWaitMs(settings.getAsLong("couchbase.bulkIndexRetryWaitMs", 1000L));
pluginSettings.setIgnoreDeletes(new ArrayList<String>(Arrays.asList(settings.get("couchbase.ignoreDeletes","").split("[:,;\\s]"))));
pluginSettings.getIgnoreDeletes().removeAll(Arrays.asList("", null));
pluginSettings.setIgnoreFailures(settings.getAsBoolean("couchbase.ignoreFailures", false));
pluginSettings.setDocumentTypeRoutingFields(settings.getByPrefix("couchbase.documentTypeRoutingFields.").getAsMap());
pluginSettings.setIgnoreDotIndexes(settings.getAsBoolean("couchbase.ignoreDotIndexes", true));
pluginSettings.setIncludeIndexes(new ArrayList<String>(Arrays.asList(settings.get("couchbase.includeIndexes", "").split("[:,;\\s]"))));
pluginSettings.getIncludeIndexes().removeAll(Arrays.asList("", null));
TypeSelector typeSelector;
Class<? extends TypeSelector> typeSelectorClass = this.getAsClass(settings.get("couchbase.typeSelector"), DefaultTypeSelector.class);
<<<<<<<
Class<? extends ParentSelector> parentSelectorClass = DefaultParentSelector.class;
=======
ParentSelector parentSelector;
Class<? extends ParentSelector> parentSelectorClass = settings.<ParentSelector>getAsClass("couchbase.parentSelector", DefaultParentSelector.class);
>>>>>>>
ParentSelector parentSelector;
Class<? extends ParentSelector> parentSelectorClass = this.getAsClass(settings.get("couchbase.parentSelector"), DefaultParentSelector.class);
<<<<<<<
Class<? extends KeyFilter> keyFilterClass = DefaultKeyFilter.class;
=======
KeyFilter keyFilter;
Class<? extends KeyFilter> keyFilterClass = settings.<KeyFilter>getAsClass("couchbase.keyFilter", DefaultKeyFilter.class);
>>>>>>>
KeyFilter keyFilter;
Class<? extends KeyFilter> keyFilterClass = this.getAsClass(settings.get("couchbase.keyFilter"), DefaultKeyFilter.class);
<<<<<<<
this.keyFilter.configure(settings);
logger.info("Couchbase transport is using key filter: {}", keyFilter.getClass().getCanonicalName());
int defaultNumVbuckets = 1024;
if(System.getProperty("os.name").toLowerCase().contains("mac")) {
logger.info("Detected platform is Mac, changing default num_vbuckets to 64");
defaultNumVbuckets = 64;
}
this.numVbuckets = settings.getAsInt("couchbase.num_vbuckets", defaultNumVbuckets);
this.bucketUUIDCache = CacheBuilder.newBuilder().expireAfterWrite(this.bucketUUIDCacheEvictMs, TimeUnit.MILLISECONDS).build();
=======
keyFilter.configure(settings);
pluginSettings.setKeyFilter(keyFilter);
>>>>>>>
keyFilter.configure(settings);
pluginSettings.setKeyFilter(keyFilter);
<<<<<<<
capiBehavior = new ElasticSearchCAPIBehavior(client, logger, keyFilter, typeSelector, parentSelector, checkpointDocumentType, dynamicTypePath, resolveConflicts, wrapCounters, maxConcurrentRequests, bulkIndexRetries, bulkIndexRetryWaitMs, bucketUUIDCache, documentTypeRoutingFields, ignoreDeletes, ignoreFailures);
couchbaseBehavior = new ElasticSearchCouchbaseBehavior(client, logger, checkpointDocumentType, bucketUUIDCache);
=======
capiBehavior = new ElasticSearchCAPIBehavior(client, logger, bucketUUIDCache, pluginSettings);
couchbaseBehavior = new ElasticSearchCouchbaseBehavior(client, logger, bucketUUIDCache, pluginSettings);
>>>>>>>
capiBehavior = new ElasticSearchCAPIBehavior(client, logger, bucketUUIDCache, pluginSettings);
couchbaseBehavior = new ElasticSearchCouchbaseBehavior(client, logger, bucketUUIDCache, pluginSettings); |
<<<<<<<
=======
import io.subutai.common.environment.Environment;
import io.subutai.common.environment.Node;
import io.subutai.common.environment.Topology;
import io.subutai.common.host.ContainerHostInfo;
>>>>>>>
import io.subutai.common.environment.Environment;
import io.subutai.common.environment.NodeGroup;
import io.subutai.common.environment.Topology;
import io.subutai.common.host.ContainerHostInfo;
<<<<<<<
=======
private Map<Integer, Map<String, Set<ContainerInfo>>> groupContainersByVlan( Set<ContainerInfo> containerInfoSet )
{
Map<Integer, Map<String, Set<ContainerInfo>>> groupedContainersByVlan = Maps.newHashMap();
for ( final ContainerInfo containerInfo : containerInfoSet )
{
//Group containers by environment relation
// and group into node groups.
Map<String, Set<ContainerInfo>> groupedContainers = groupedContainersByVlan.get( containerInfo.getVlan() );
if ( groupedContainers == null )
{
groupedContainers = Maps.newHashMap();
}
//Group by container infos by container name
Set<ContainerInfo> group = groupedContainers.get( containerInfo.getTemplateName() );
if ( group != null )
{
group.add( containerInfo );
}
else
{
group = Sets.newHashSet( containerInfo );
}
if ( containerInfo.getVlan() != null && containerInfo.getVlan() != 0 )
{
groupedContainers.put( containerInfo.getTemplateName(), group );
groupedContainersByVlan.put( containerInfo.getVlan(), groupedContainers );
}
}
return groupedContainersByVlan;
}
private void processEnvironmentImport( RequestedHostImpl registrationRequest )
{
Map<Integer, Map<String, Set<ContainerInfo>>> groupedContainersByVlan =
groupContainersByVlan( registrationRequest.getHostInfos() );
for ( final Map.Entry<Integer, Map<String, Set<ContainerInfo>>> mapEntry : groupedContainersByVlan.entrySet() )
{
//TODO: check this run. Topology constructor changed
Topology topology = new Topology( "Imported-environment", 0, 0 );
Map<String, Set<ContainerInfo>> rawNodeGroup = mapEntry.getValue();
Map<Node, Set<ContainerHostInfo>> classification = Maps.newHashMap();
for ( final Map.Entry<String, Set<ContainerInfo>> entry : rawNodeGroup.entrySet() )
{
//place where to create node groups
String templateName = entry.getKey();
//TODO: please change this distribution
Node node =
new Node( UUID.randomUUID().toString(), String.format( "%s_group", templateName ), templateName, ContainerSize.SMALL, 1,
1, localPeer.getId(), registrationRequest.getId() );
topology.addNodePlacement( localPeer.getId(), node );
Set<ContainerHostInfo> converter = Sets.newHashSet();
converter.addAll( entry.getValue() );
classification.put( node, converter );
}
//trigger environment import task
try
{
Environment environment = environmentManager
.importEnvironment( String.format( "environment_%d", mapEntry.getKey() ), topology,
classification, mapEntry.getKey() );
//Save container gateway from environment configuration to update container network configuration
// later when it will be available
SubnetUtils cidr;
try
{
cidr = new SubnetUtils( environment.getSubnetCidr() );
}
catch ( IllegalArgumentException e )
{
throw new RuntimeException( "Failed to parse subnet CIDR", e );
}
String gateway = cidr.getInfo().getLowAddress();
for ( final Set<ContainerHostInfo> infos : classification.values() )
{
//TODO: sign CH key with PEK (identified by LocalPeerId+environment.getId())
for ( final ContainerHostInfo hostInfo : infos )
{
ContainerInfoImpl containerInfo = containerInfoDataService.find( hostInfo.getId() );
containerInfo.setGateway( gateway );
containerInfo.setStatus( RegistrationStatus.APPROVED );
containerInfoDataService.update( containerInfo );
}
}
}
catch ( EnvironmentCreationException e )
{
LOGGER.error( "Error importing environment", e );
}
}
}
>>>>>>> |
<<<<<<<
import io.subutai.common.util.ServiceLocator;
import io.subutai.core.identity.api.model.Role;
import io.subutai.core.identity.api.model.User;
import io.subutai.server.ui.MainUI;
import io.subutai.server.ui.api.PortalModule;
import io.subutai.server.ui.api.PortalModuleListener;
import io.subutai.server.ui.api.PortalModuleService;
=======
>>>>>>>
import io.subutai.common.util.ServiceLocator;
import io.subutai.core.identity.api.model.Role;
import io.subutai.core.identity.api.model.User;
import io.subutai.server.ui.MainUI;
import io.subutai.server.ui.api.PortalModule;
import io.subutai.server.ui.api.PortalModuleListener;
import io.subutai.server.ui.api.PortalModuleService; |
<<<<<<<
=======
import com.google.common.collect.Sets;
import com.google.gson.Gson;
>>>>>>>
import com.google.common.collect.Sets;
import com.google.gson.Gson;
<<<<<<<
return getLicenseFromUri(LISTED_LICENSE_URI_PREFIX + this.listdLicenseIds.get(licenseId.toLowerCase()));
=======
SpdxListedLicense retval = getLicenseFromUri(LISTED_LICENSE_URI_PREFIX + licenseId + JSONLD_URL_SUFFIX);
if (retval != null) {
retval = (SpdxListedLicense)retval.clone(); // We need to clone the license to remove the references to the model in the cache
}
return retval;
>>>>>>>
SpdxListedLicense retval = getLicenseFromUri(LISTED_LICENSE_URI_PREFIX + licenseId + JSONLD_URL_SUFFIX);
if (retval != null) {
retval = (SpdxListedLicense)retval.clone(); // We need to clone the license to remove the references to the model in the cache
}
return retval; |
<<<<<<<
=======
import org.safehaus.subutai.common.util.ServiceLocator;
import org.safehaus.subutai.core.environment.api.EnvironmentManager;
import org.safehaus.subutai.core.peer.api.ContainerHost;
>>>>>>>
import org.safehaus.subutai.common.util.ServiceLocator;
import org.safehaus.subutai.core.environment.api.EnvironmentManager;
import org.safehaus.subutai.core.peer.api.ContainerHost;
<<<<<<<
this.mongo = mongo;
this.tracker = tracker;
=======
this.tracker = serviceLocator.getService( Tracker.class );
this.mongo = serviceLocator.getService( Mongo.class );
this.environmentManager = serviceLocator.getService( EnvironmentManager.class );
>>>>>>>
this.mongo = mongo;
this.tracker = tracker;
this.environmentManager = environmentManager; |
<<<<<<<
=======
import org.safehaus.subutai.core.container.api.ContainerCreateException;
import org.safehaus.subutai.core.lxc.quota.api.QuotaEnum;
>>>>>>>
import org.safehaus.subutai.core.container.api.ContainerCreateException;
import org.safehaus.subutai.core.lxc.quota.api.QuotaEnum;
<<<<<<<
=======
@Override
public String getQuota( final ContainerHost host, final QuotaEnum quota ) throws PeerException
{
throw new PeerException( "Operation not allowed.");
// String path = "peer/container/getquota";
//
//
// WebClient client = createWebClient();
//
// Form form = new Form();
// form.set( "host", JsonUtil.toJson( host ) );
// Response response = client.path( path ).type( MediaType.APPLICATION_FORM_URLENCODED_TYPE )
// .accept( MediaType.APPLICATION_JSON ).post( form );
//
// if ( response.getStatus() == Response.Status.OK.getStatusCode() )
// {
// return response.readEntity( String.class );
// }
// else
// {
// throw new PeerException( response.getEntity().toString() );
// }
}
@Override
public void setQuota( final ContainerHost host, final QuotaEnum quota, final String value ) throws PeerException
{
throw new PeerException( "Operation not allowed.");
// String path = "peer/container/setquota";
//
//
// WebClient client = createWebClient();
//
// Form form = new Form();
// form.set( "host", JsonUtil.toJson( host ) );
// form.set( "quota", quota );
// form.set( "value", value );
//
// Response response = client.path( path ).type( MediaType.APPLICATION_FORM_URLENCODED_TYPE )
// .accept( MediaType.APPLICATION_JSON ).post( form );
//
// if ( response.getStatus() != Response.Status.OK.getStatusCode() )
// {
// throw new PeerException( response.getEntity().toString() );
// }
}
@Override
public CommandResult execute( final RequestBuilder requestBuilder, final Host host ) throws CommandException
{
if ( !( host instanceof ContainerHost ) )
{
throw new CommandException( "Operation not allowed." );
}
String path = "peer/execute";
WebClient client = createWebClient();
Form form = new Form();
form.set( "requestBuilder", JsonUtil.toJson( requestBuilder ) );
form.set( "host", JsonUtil.toJson( host ) );
Response response = client.path( path ).type( MediaType.APPLICATION_FORM_URLENCODED_TYPE )
.accept( MediaType.APPLICATION_JSON ).post( form );
String jsonObject = response.readEntity( String.class );
if ( response.getStatus() == Response.Status.OK.getStatusCode() )
{
CommandResult result = JsonUtil.fromJson( jsonObject, CommandResult.class );
return result;
}
if ( response.getStatus() == Response.Status.INTERNAL_SERVER_ERROR.getStatusCode() )
{
throw new CommandException( response.getEntity().toString() );
}
else
{
throw new CommandException( "Unknown response: " + response.getEntity().toString() );
}
}
@Override
public CommandResult execute( final RequestBuilder requestBuilder, final Host host, final CommandCallback callback )
throws CommandException
{
return null;
}
@Override
public void executeAsync( final RequestBuilder requestBuilder, final Host host, final CommandCallback callback )
throws CommandException
{
}
@Override
public void executeAsync( final RequestBuilder requestBuilder, final Host host ) throws CommandException
{
}
@Override
public boolean isLocal()
{
return false;
}
@Override
public Set<ContainerHost> createContainers( final UUID creatorPeerId, final UUID environmentId,
final List<Template> templates, final int quantity,
final String strategyId, final List<Criteria> criteria )
throws ContainerCreateException
{
String path = "peer/container/create";
WebClient client = createWebClient();
Form form = new Form();
form.set( "ownerPeerId", creatorPeerId.toString() );
form.set( "environmentId", environmentId.toString() );
form.set( "templates", JsonUtil.toJson( templates ) );
form.set( "quantity", quantity );
form.set( "strategyId", strategyId );
// TODO: implement criteria transfer
form.set( "criteria", "" );
Response response = client.path( path ).type( MediaType.APPLICATION_FORM_URLENCODED_TYPE )
.accept( MediaType.APPLICATION_JSON ).form( form );
String jsonObject = response.readEntity( String.class );
if ( response.getStatus() == Response.Status.OK.getStatusCode() )
{
Set<ContainerHost> result = JsonUtil.fromJson( jsonObject, new TypeToken<Set<ContainerHost>>()
{
}.getType() );
return result;
}
if ( response.getStatus() == Response.Status.INTERNAL_SERVER_ERROR.getStatusCode() )
{
throw new ContainerCreateException( response.getEntity().toString() );
}
else
{
return null;
}
}
public void invoke( String ip, String port, PeerCommandMessage peerCommandMessage )
{
String path = "peer/invoke";
try
{
baseUrl = String.format( baseUrl, ip, port );
LOG.info( baseUrl );
WebClient client = WebClient.create( baseUrl );
Form form = new Form();
form.set( "commandType", peerCommandMessage.getType().toString() );
form.set( "command", peerCommandMessage.toJson() );
HTTPConduit httpConduit = ( HTTPConduit ) WebClient.getConfig( client ).getConduit();
HTTPClientPolicy httpClientPolicy = new HTTPClientPolicy();
httpClientPolicy.setConnectionTimeout( connectionTimeout );
httpClientPolicy.setReceiveTimeout( receiveTimeout );
httpConduit.setClient( httpClientPolicy );
Response response = client.path( path ).type( MediaType.APPLICATION_FORM_URLENCODED_TYPE )
.accept( MediaType.APPLICATION_JSON ).form( form );
String jsonObject = response.readEntity( String.class );
PeerCommandMessage result = JsonUtil.fromJson( jsonObject, peerCommandMessage.getClass() );
if ( response.getStatus() == Response.Status.OK.getStatusCode() )
{
peerCommandMessage.setResult( result.getResult() );
// peerCommandMessage.setSuccess( result.isSuccess() );
LOG.debug( String.format( "Remote command result: %s", result.toString() ) );
// return ccm;
}
else
{
// peerCommandMessage.setSuccess( false );
peerCommandMessage.setExceptionMessage( result.getExceptionMessage() );
// return ccm;
}
}
catch ( Exception e )
{
LOG.error( e.getMessage() );
// peerCommandMessage.setSuccess( false );
peerCommandMessage.setExceptionMessage( e.toString() );
// throw new RuntimeException( "Error while invoking REST Client" );
}
//return null;
}
>>>>>>> |
<<<<<<<
import io.subutai.core.environment.impl.dao.EnvironmentService;
=======
import io.subutai.core.environment.impl.dao.EnvironmentDataService;
import io.subutai.core.environment.impl.entity.EnvironmentAlertHandlerImpl;
>>>>>>>
import io.subutai.core.environment.impl.entity.EnvironmentAlertHandlerImpl;
import io.subutai.core.environment.impl.dao.EnvironmentService;
<<<<<<<
=======
protected EnvironmentDataService environmentDataService;
>>>>>>>
<<<<<<<
=======
this.environmentDataService = new EnvironmentDataService( daoManager );
>>>>>>>
<<<<<<<
public int setupContainerSsh( final String containerHostId, final String environmentId )
throws EnvironmentModificationException, EnvironmentNotFoundException, ContainerHostNotFoundException
{
Preconditions.checkArgument( !Strings.isNullOrEmpty( containerHostId ), "Invalid container id" );
Preconditions.checkArgument( !Strings.isNullOrEmpty( environmentId ), "Invalid environment id" );
final EnvironmentImpl environment = ( EnvironmentImpl ) loadEnvironment( environmentId );
EnvironmentContainerHost environmentContainer = environment.getContainerHostById( containerHostId );
if ( !relationManager.getRelationInfoManager().allHasUpdatePermissions( environmentContainer ) )
{
throw new ContainerHostNotFoundException( "Container host not found." );
}
TrackerOperation operationTracker = tracker.createTrackerOperation( MODULE_NAME,
String.format( "Setting up ssh for container %s ", containerHostId ) );
environment.getContainerHostById( containerHostId );
try
{
int sshPort =
peerManager.getLocalPeer().setupContainerSsh( containerHostId, Common.CONTAINER_SSH_TIMEOUT_SEC );
operationTracker.addLogDone(
String.format( "Ssh for container %s is ready on port %d", containerHostId, sshPort ) );
return sshPort;
}
catch ( Exception e )
{
operationTracker.addLogFailed(
String.format( "Error setting up ssh for container %s: %s", containerHostId, e.getMessage() ) );
throw new EnvironmentModificationException( e );
}
}
@RolesAllowed( "Environment-Management|Update" )
@Override
=======
>>>>>>> |
<<<<<<<
import io.subutai.core.peer.api.PeerManager;
=======
import io.subutai.core.trust.api.RelationManager;
import io.subutai.core.trust.api.model.Relation;
import io.subutai.core.trust.api.model.RelationInfo;
import io.subutai.core.trust.api.model.RelationInfoMeta;
import io.subutai.core.trust.api.model.RelationMeta;
>>>>>>>
import io.subutai.core.trust.api.RelationManager;
import io.subutai.core.trust.api.model.Relation;
import io.subutai.core.trust.api.model.RelationInfo;
import io.subutai.core.trust.api.model.RelationInfoMeta;
import io.subutai.core.trust.api.model.RelationMeta;
import io.subutai.core.peer.api.PeerManager; |
<<<<<<<
try
{
logger.debug( "Received hostId: " + hostId );
KeyManager keyManager = securityManager.getKeyManager();
KeyIdentityDTO keyIdentityDTO = new KeyIdentityDTO( keyManager.getKeyTrustTree( hostId ) );
keyIdentityDTO.setChild( false );
keyIdentityDTO.setTrustLevel( KeyTrustLevel.Ultimate.getId() );
keyIdentityDTO.setParentId( keyIdentityDTO.getHostId() );
keyIdentityDTO.setParentPublicKeyFingerprint( keyIdentityDTO.getParentPublicKeyFingerprint() );
resetTrustLevels( keyIdentityDTO, keyManager );
return Response.ok( JsonUtil.toJson( keyIdentityDTO ) ).build();
}
catch ( Exception ex )
{
return Response.serverError().build();
}
}
private void resetTrustLevels( KeyIdentityDTO keyIdentityDTO, KeyManager keyManager )
{
for ( final KeyIdentityDTO identityDTO : keyIdentityDTO.getTrusts() )
{
identityDTO.setParentId( keyIdentityDTO.getHostId() );
identityDTO.setParentPublicKeyFingerprint( keyIdentityDTO.getPublicKeyFingerprint() );
identityDTO.setChild( true );
identityDTO
.setTrustLevel( keyManager.getTrustLevel( keyIdentityDTO.getHostId(), identityDTO.getHostId() ) );
resetTrustLevels( identityDTO, keyManager );
}
=======
logger.debug( "Received hostId: " + hostId );
KeyManager keyManager = securityManager.getKeyManager();
KeyIdentityDTO keyIdentityDTO = new KeyIdentityDTO( keyManager.getKeyTrustTree( hostId ) );
keyIdentityDTO.setChild( false );
keyIdentityDTO.setTrustLevel( KeyTrustLevel.Ultimate.getId() );
resetTrustLevels( keyIdentityDTO, keyManager );
return Response.ok( JsonUtil.toJson( keyIdentityDTO ) ).build();
}
private void resetTrustLevels( KeyIdentityDTO keyIdentityDTO, KeyManager keyManager )
{
for ( final KeyIdentityDTO identityDTO : keyIdentityDTO.getTrusts() )
{
identityDTO.setChild( true );
identityDTO
.setTrustLevel( keyManager.getTrustLevel( keyIdentityDTO.getIdentityId(), identityDTO.getIdentityId() ) );
resetTrustLevels( identityDTO, keyManager );
}
>>>>>>>
try
{
logger.debug( "Received hostId: " + hostId );
KeyManager keyManager = securityManager.getKeyManager();
KeyIdentityDTO keyIdentityDTO = new KeyIdentityDTO( keyManager.getKeyTrustTree( hostId ) );
keyIdentityDTO.setChild( false );
keyIdentityDTO.setTrustLevel( KeyTrustLevel.Ultimate.getId() );
keyIdentityDTO.setParentId( keyIdentityDTO.getHostId() );
keyIdentityDTO.setParentPublicKeyFingerprint( keyIdentityDTO.getParentPublicKeyFingerprint() );
resetTrustLevels( keyIdentityDTO, keyManager );
return Response.ok( JsonUtil.toJson( keyIdentityDTO ) ).build();
}
catch ( Exception ex )
{
return Response.serverError().build();
}
}
private void resetTrustLevels( KeyIdentityDTO keyIdentityDTO, KeyManager keyManager )
{
for ( final KeyIdentityDTO identityDTO : keyIdentityDTO.getTrusts() )
{
identityDTO.setParentId( keyIdentityDTO.getHostId() );
identityDTO.setParentPublicKeyFingerprint( keyIdentityDTO.getPublicKeyFingerprint() );
identityDTO.setChild( true );
identityDTO
.setTrustLevel( keyManager.getTrustLevel( keyIdentityDTO.getIdentityId(), identityDTO.getIdentityId() ) );
resetTrustLevels( identityDTO, keyManager );
} |
<<<<<<<
import io.subutai.common.security.objects.PermissionObject;
import io.subutai.common.security.relation.RelationLinkDto;
import io.subutai.common.settings.SecuritySettings;
import io.subutai.common.settings.SystemSettings;
=======
>>>>>>>
import io.subutai.common.security.objects.PermissionObject;
import io.subutai.common.security.relation.RelationLinkDto;
import io.subutai.common.settings.SecuritySettings;
import io.subutai.common.settings.SystemSettings;
<<<<<<<
private String baseUrl;
Object provider;
private String localPeerId;
private RelationManager relationManager;
private LocalPeer localPeer;
private PeerWebClient peerWebClient;
private EnvironmentWebClient environmentWebClient;
=======
>>>>>>>
private String baseUrl;
private String localPeerId;
private RelationManager relationManager;
private LocalPeer localPeer;
private PeerWebClient peerWebClient;
private EnvironmentWebClient environmentWebClient;
<<<<<<<
this.relationManager = peerManager.getRelationManager();
this.localPeer = peerManager.getLocalPeer();
String url;
int port = peerInfo.getPublicSecurePort();
if ( port == SystemSettings.getSpecialPortX1() || port == SystemSettings.getOpenPort() )
{
url = String.format( "http://%s:%s/rest/v1/peer", peerInfo, peerInfo.getPublicSecurePort() );
}
else
{
url = String.format( "https://%s:%s/rest/v1/peer", peerInfo, peerInfo.getPublicSecurePort() );
}
this.baseUrl = url;
=======
>>>>>>>
this.relationManager = peerManager.getRelationManager();
this.localPeer = peerManager.getLocalPeer();
<<<<<<<
protected String request( RestUtil.RequestType requestType, String path, String alias, Map<String, String> params,
Map<String, String> headers ) throws HTTPException
{
try
{
checkRelation();
}
catch ( RelationVerificationException e )
{
throw new HTTPException( e.getMessage() );
}
return restUtil.request( requestType,
String.format( "%s/%s", baseUrl, path.startsWith( "/" ) ? path.substring( 1 ) : path ), alias, params,
headers, provider );
}
protected String get( String path, String alias, Map<String, String> params, Map<String, String> headers )
throws HTTPException
{
return request( RestUtil.RequestType.GET, path, alias, params, headers );
}
protected String post( String path, String alias, Map<String, String> params, Map<String, String> headers )
throws HTTPException
{
return request( RestUtil.RequestType.POST, path, alias, params, headers );
}
protected String delete( String path, String alias, Map<String, String> params, Map<String, String> headers )
throws HTTPException
{
return request( RestUtil.RequestType.DELETE, path, alias, params, headers );
}
=======
>>>>>>>
<<<<<<<
PeerInfo response = peerWebClient.getInfo();
=======
PeerInfo response = new PeerWebClient( peerInfo, provider ).getInfo();
>>>>>>>
PeerInfo response = peerWebClient.getInfo();
<<<<<<<
environmentWebClient.startContainer( peerInfo, containerId );
=======
new EnvironmentWebClient( peerInfo, provider ).startContainer( containerId );
>>>>>>>
environmentWebClient.startContainer( peerInfo, containerId );
<<<<<<<
environmentWebClient.stopContainer( peerInfo, containerId );
=======
new EnvironmentWebClient( peerInfo, provider ).stopContainer( containerId );
>>>>>>>
environmentWebClient.stopContainer( peerInfo, containerId );
<<<<<<<
environmentWebClient.destroyContainer( peerInfo, containerId );
=======
Preconditions.checkNotNull( containerId, "Container id is null" );
Preconditions.checkArgument( containerId.getPeerId().getId().equals( peerInfo.getId() ) );
new EnvironmentWebClient( peerInfo, provider ).destroyContainer( containerId );
>>>>>>>
Preconditions.checkNotNull( containerId, "Container id is null" );
Preconditions.checkArgument( containerId.getPeerId().getId().equals( peerInfo.getId() ) );
environmentWebClient.destroyContainer( containerId );
<<<<<<<
if ( containerId.getEnvironmentId() == null )
{
return peerWebClient.getProcessResourceUsage( containerId, pid );
}
else
{
return environmentWebClient.getProcessResourceUsage( peerInfo, containerId, pid );
}
=======
return new EnvironmentWebClient( peerInfo, provider ).getProcessResourceUsage( containerId, pid );
>>>>>>>
return environmentWebClient.getProcessResourceUsage( containerId, pid );
<<<<<<<
return environmentWebClient.getState( peerInfo, containerId );
=======
return new EnvironmentWebClient( peerInfo, provider ).getState( containerId );
>>>>>>>
return environmentWebClient.getState( peerInfo, containerId );
<<<<<<<
return environmentWebClient.getCpuSet( peerInfo, containerHost.getContainerId() );
=======
return new EnvironmentWebClient( peerInfo, provider ).getCpuSet( containerHost.getContainerId() );
>>>>>>>
return environmentWebClient.getCpuSet( peerInfo, containerHost.getContainerId() );
<<<<<<<
environmentWebClient.setCpuSet( peerInfo, containerHost.getContainerId(), cpuSet );
=======
new EnvironmentWebClient( peerInfo, provider ).setCpuSet( containerHost.getContainerId(), cpuSet );
>>>>>>>
environmentWebClient.setCpuSet( peerInfo, containerHost.getContainerId(), cpuSet );
<<<<<<<
return environmentWebClient.generateSshKeysForEnvironment( peerInfo, environmentId );
=======
return new EnvironmentWebClient( peerInfo, provider ).generateSshKeysForEnvironment( environmentId );
>>>>>>>
return environmentWebClient.generateSshKeysForEnvironment( peerInfo, environmentId );
<<<<<<<
environmentWebClient.configureSshInEnvironment( peerInfo, environmentId, sshPublicKeys );
=======
new EnvironmentWebClient( peerInfo, provider ).configureSshInEnvironment( environmentId, sshPublicKeys );
>>>>>>>
environmentWebClient.configureSshInEnvironment( environmentId, sshPublicKeys );
<<<<<<<
environmentWebClient.configureHostsInEnvironment( peerInfo, environmentId, hostAddresses );
=======
new EnvironmentWebClient( peerInfo, provider ).addSshKey( environmentId, sshPublicKey );
>>>>>>>
environmentWebClient.addSshKey( environmentId, sshPublicKey );
<<<<<<<
return environmentWebClient.getQuota( peerInfo, containerId );
=======
new EnvironmentWebClient( peerInfo, provider ).removeSshKey( environmentId, sshPublicKey );
>>>>>>>
environmentWebClient.removeSshKey( environmentId, sshPublicKey );
<<<<<<<
environmentWebClient.setQuota( peerInfo, containerId, containerQuota );
=======
new EnvironmentWebClient( peerInfo, provider ).configureHostsInEnvironment( environmentId, hostAddresses );
>>>>>>>
environmentWebClient.configureHostsInEnvironment( peerInfo, environmentId, hostAddresses );
<<<<<<<
return environmentWebClient.getAvailableQuota( peerInfo, containerId );
=======
return new EnvironmentWebClient( peerInfo, provider ).getQuota( containerId );
>>>>>>>
return environmentWebClient.getQuota( peerInfo, containerId );
<<<<<<<
try
{
peerWebClient.setupTunnels( p2pIps, environmentId );
}
catch ( Exception e )
{
throw new PeerException( String.format( "Error setting up tunnels on peer %s", getName() ), e );
}
=======
new PeerWebClient( peerInfo, provider ).setupTunnels( p2pIps, environmentId );
>>>>>>>
peerWebClient.setupTunnels( p2pIps, environmentId );
<<<<<<<
if ( containerId.getEnvironmentId() == null )
{
return peerWebClient.getResourceHosIdByContainerId( containerId );
}
else
{
return environmentWebClient.getResourceHostIdByContainerId( peerInfo, containerId );
}
=======
return new EnvironmentWebClient( peerInfo, provider ).getResourceHostIdByContainerId( containerId );
>>>>>>>
return environmentWebClient.getResourceHostIdByContainerId( containerId );
<<<<<<<
peerWebClient.alert( alert );
=======
Preconditions.checkNotNull( alert );
new PeerWebClient( peerInfo, provider ).alert( alert );
>>>>>>>
Preconditions.checkNotNull( alert );
peerWebClient.alert( alert );
<<<<<<<
return peerWebClient.getHistoricalMetrics( hostname, startTime, endTime );
=======
Preconditions.checkArgument( !Strings.isNullOrEmpty( hostname ) );
Preconditions.checkNotNull( startTime );
Preconditions.checkNotNull( endTime );
return new PeerWebClient( peerInfo, provider ).getHistoricalMetrics( hostname, startTime, endTime );
>>>>>>>
Preconditions.checkArgument( !Strings.isNullOrEmpty( hostname ) );
Preconditions.checkNotNull( startTime );
Preconditions.checkNotNull( endTime );
return peerWebClient.getHistoricalMetrics( hostname, startTime, endTime );
<<<<<<<
return peerWebClient.getResourceLimits( peerId );
=======
Preconditions.checkArgument( !Strings.isNullOrEmpty( peerId ) );
return new PeerWebClient( peerInfo, provider ).getResourceLimits( peerId );
>>>>>>>
Preconditions.checkArgument( !Strings.isNullOrEmpty( peerId ) );
return peerWebClient.getResourceLimits( peerId );
<<<<<<<
return peerWebClient.getP2PSwarmDistances( p2pHash, maxAddress );
=======
new EnvironmentWebClient( peerInfo, provider ).addReverseProxy( reverseProxyConfig );
>>>>>>>
environmentWebClient.addReverseProxy( reverseProxyConfig ); |
<<<<<<<
import org.safehaus.subutai.core.peer.api.PeerStatus;
import org.safehaus.subutai.core.peer.ui.PeerUI;
=======
import org.safehaus.subutai.core.peer.ui.PeerManagerPortalModule;
>>>>>>>
import org.safehaus.subutai.core.peer.api.PeerStatus;
import org.safehaus.subutai.core.peer.ui.PeerManagerPortalModule;
<<<<<<<
switch ( peer.getStatus() )
{
case REQUESTED:
{
peer.setStatus( PeerStatus.APPROVED );
peerUI.getPeerManager().register( peer );
clickEvent.getButton().setCaption( "Unregister" );
break;
}
case APPROVED:
{
peerUI.getPeerManager().unregister( peer.getId().toString() );
break;
}
}
=======
peerManagerPortalModule.getPeerManager().unregister( peer.getId().toString() );
>>>>>>>
switch ( peer.getStatus() )
{
case REQUESTED:
{
peer.setStatus( PeerStatus.APPROVED );
peerManagerPortalModule.getPeerManager().register( peer );
clickEvent.getButton().setCaption( "Unregister" );
break;
}
case APPROVED:
{
peerManagerPortalModule.getPeerManager().unregister( peer.getId().toString() );
break;
}
}
<<<<<<<
getUI().access( new Runnable()
=======
Peer peer = new Peer();
String name = nameTextField.getValue();
String ip = ipTextField.getValue();
String id = idTextField.getValue();
if ( name.length() > 0 && ip.length() > 0 && id.length() > 0 )
{
peer.setName( name );
peer.setIp( ip );
peer.setId( UUID.fromString( id ) );
peerManagerPortalModule.getPeerManager().register( peer );
}
else
>>>>>>>
getUI().access( new Runnable() |
<<<<<<<
import io.subutai.core.hubmanager.impl.processor.ProxyProcessor;
import io.subutai.core.hubmanager.impl.processor.port_map.ContainerPortMapProcessor;
=======
>>>>>>>
import io.subutai.core.hubmanager.impl.processor.ProxyProcessor;
import io.subutai.core.hubmanager.impl.processor.port_map.ContainerPortMapProcessor;
<<<<<<<
.addProcessor( commandProcessor )
.addProcessor( productProcessor )
.addProcessor( proxyProcessor )
=======
>>>>>>>
.addProcessor( proxyProcessor ) |
<<<<<<<
import java.util.BitSet;
=======
import java.util.Calendar;
>>>>>>>
import java.util.BitSet;
import java.util.Calendar; |
<<<<<<<
import com.kylinolap.job.execution.AbstractExecutable;
import com.kylinolap.metadata.model.SegmentStatusEnum;
import org.apache.commons.lang.StringUtils;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
=======
import com.kylinolap.job.impl.threadpool.AbstractExecutable;
>>>>>>>
import org.apache.commons.lang.StringUtils;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List; |
<<<<<<<
final String segmentIds = job.getRelatedSegment();
for (String segmentId : StringUtils.split(segmentIds)) {
final CubeSegment segment = cubeInstance.getSegmentById(segmentId);
if (segment != null && (segment.getStatus() == SegmentStatusEnum.NEW || segment.getTSRange().end.v == 0)) {
// Remove this segment
getCubeManager().updateCubeDropSegments(cubeInstance, segment);
=======
final String segmentIds = CubingExecutableUtil.getSegmentId(cubingJob.getParams());
if (!StringUtils.isEmpty(segmentIds)) {
List<CubeSegment> toRemoveSegments = Lists.newLinkedList();
for (String segmentId : StringUtils.split(segmentIds)) {
final CubeSegment segment = cubeInstance.getSegmentById(segmentId);
if (segment != null
&& (segment.getStatus() == SegmentStatusEnum.NEW || segment.getTSRange().end.v == 0)) {
// Remove this segment
toRemoveSegments.add(segment);
}
}
if (!toRemoveSegments.isEmpty()) {
CubeUpdate cubeBuilder = new CubeUpdate(cubeInstance);
cubeBuilder.setToRemoveSegs(toRemoveSegments.toArray(new CubeSegment[toRemoveSegments.size()]));
getCubeManager().updateCube(cubeBuilder);
>>>>>>>
final String segmentIds = CubingExecutableUtil.getSegmentId(cubingJob.getParams());
if (!StringUtils.isEmpty(segmentIds)) {
for (String segmentId : StringUtils.split(segmentIds)) {
final CubeSegment segment = cubeInstance.getSegmentById(segmentId);
if (segment != null
&& (segment.getStatus() == SegmentStatusEnum.NEW || segment.getTSRange().end.v == 0)) {
// Remove this segment
getCubeManager().updateCubeDropSegments(cubeInstance, segment);
} |
<<<<<<<
import org.apache.kylin.rest.util.AclPermissionUtil;
=======
import org.apache.kylin.rest.util.QueryRequestLimits;
>>>>>>>
import org.apache.kylin.rest.util.AclPermissionUtil;
import org.apache.kylin.rest.util.QueryRequestLimits;
<<<<<<<
return doQueryWithCache(sqlRequest, false);
}
public SQLResponse doQueryWithCache(SQLRequest sqlRequest, boolean isQueryInspect) {
=======
return doQueryWithCache(sqlRequest, true);
}
public SQLResponse doQueryWithCache(SQLRequest sqlRequest, boolean secureEnabled) {
>>>>>>>
return doQueryWithCache(sqlRequest, false);
}
public SQLResponse doQueryWithCache(SQLRequest sqlRequest, boolean isQueryInspect) { |
<<<<<<<
// final StreamingBootstrap bootstrap = StreamingBootstrap.getInstance(kylinConfig);
// bootstrap.start("eagle", 0);
// Thread.sleep(30 * 60 * 1000);
// logger.info("time is up, stop streaming");
// bootstrap.stop();
// Thread.sleep(5 * 1000);
=======
//StreamingBootstrap.getInstance(kylinConfig).startStreaming("eagle", 0);
>>>>>>>
final StreamingBootstrap bootstrap = StreamingBootstrap.getInstance(kylinConfig);
bootstrap.start("eagle", 0);
Thread.sleep(30 * 60 * 1000);
logger.info("time is up, stop streaming");
bootstrap.stop();
Thread.sleep(5 * 1000); |
<<<<<<<
public static final String DISPALY_NAME = "displayName";
=======
public static final String SEGMENT_NAME = "segmentName";
>>>>>>>
public static final String DISPALY_NAME = "displayName";
public static final String SEGMENT_NAME = "segmentName"; |
<<<<<<<
public JobInstance createJob(String cubeName, String segmentName, String segmentId, RealizationBuildTypeEnum jobType) throws IOException {
=======
public JobInstance createJob(String cubeName, String segmentName, String segmentId, CubeBuildTypeEnum jobType, String submitter) throws IOException {
>>>>>>>
public JobInstance createJob(String cubeName, String segmentName, String segmentId, RealizationBuildTypeEnum jobType, String submitter) throws IOException {
<<<<<<<
private JobInstance buildJobInstance(String cubeName, String segmentName, String segmentId, RealizationBuildTypeEnum jobType) {
=======
private JobInstance buildJobInstance(String cubeName, String segmentName, String segmentId, CubeBuildTypeEnum jobType, String submitter) {
>>>>>>>
private JobInstance buildJobInstance(String cubeName, String segmentName, String segmentId, RealizationBuildTypeEnum jobType, String submitter) { |
<<<<<<<
long streamOffset = streamManager.getOffset(streaming, partitionId);
=======
long streamOffset = ii.getStreamOffsets().get(partitionId);
logger.info("offset from ii desc is " + streamOffset);
logger.info("offset from KafkaRequester is " + earliestOffset);
>>>>>>>
long streamOffset = streamManager.getOffset(streaming, partitionId);
logger.info("offset from ii desc is " + streamOffset);
logger.info("offset from KafkaRequester is " + earliestOffset); |
<<<<<<<
import com.google.common.base.Preconditions;
import com.google.common.collect.Lists;
import com.kylinolap.metadata.project.ProjectInstance;
import com.kylinolap.metadata.realization.*;
=======
>>>>>>>
import com.google.common.base.Preconditions;
import com.google.common.collect.Lists; |
<<<<<<<
import org.apache.hadoop.mapreduce.Mapper;
import org.apache.hive.hcatalog.data.HCatRecord;
import org.apache.hive.hcatalog.data.schema.HCatFieldSchema;
import org.apache.hive.hcatalog.data.schema.HCatSchema;
import org.apache.hive.hcatalog.mapreduce.HCatInputFormat;
=======
import org.apache.hadoop.io.Text;
>>>>>>>
import org.apache.hive.hcatalog.data.HCatRecord;
import org.apache.hive.hcatalog.data.schema.HCatFieldSchema;
import org.apache.hive.hcatalog.data.schema.HCatSchema;
import org.apache.hive.hcatalog.mapreduce.HCatInputFormat;
<<<<<<<
public class ColumnCardinalityMapper<T> extends Mapper<T, HCatRecord, IntWritable, BytesWritable> {
=======
public class ColumnCardinalityMapper<T> extends KylinMapper<T, Text, IntWritable, BytesWritable> {
>>>>>>>
public class ColumnCardinalityMapper<T> extends KylinMapper<T, HCatRecord, IntWritable, BytesWritable> {
<<<<<<<
protected void setup(Context context) throws IOException {
schema = HCatInputFormat.getTableSchema(context.getConfiguration());
columnSize = schema.getFields().size();
}
@Override
public void map(T key, HCatRecord value, Context context) throws IOException, InterruptedException {
HCatFieldSchema field;
Object fieldValue;
for (int m = 0; m < columnSize; m++) {
field = schema.get(m);
fieldValue = value.get(field.getName(), schema);
if (fieldValue == null)
fieldValue = "NULL";
if (counter < 5 && m < 10) {
System.out.println("Get row " + counter + " column '" + field.getName() + "' value: " + fieldValue);
}
if (fieldValue != null)
getHllc(m).add(Bytes.toBytes(fieldValue.toString()));
=======
protected void setup(Context context) throws IOException {
super.publishConfiguration(context.getConfiguration());
}
@Override
public void map(T key, Text value, Context context) throws IOException, InterruptedException {
String delim = context.getConfiguration().get(HiveColumnCardinalityJob.KEY_INPUT_DELIM);
if (delim == null) {
delim = DEFAULT_DELIM;
}
String line = value.toString();
StringTokenizer tokenizer = new StringTokenizer(line, delim);
int i = 1;
while (tokenizer.hasMoreTokens()) {
String temp = tokenizer.nextToken();
getHllc(i).add(Bytes.toBytes(temp));
i++;
>>>>>>>
protected void setup(Context context) throws IOException {
super.publishConfiguration(context.getConfiguration());
schema = HCatInputFormat.getTableSchema(context.getConfiguration());
columnSize = schema.getFields().size();
}
@Override
public void map(T key, HCatRecord value, Context context) throws IOException, InterruptedException {
HCatFieldSchema field;
Object fieldValue;
for (int m = 0; m < columnSize; m++) {
field = schema.get(m);
fieldValue = value.get(field.getName(), schema);
if (fieldValue == null)
fieldValue = "NULL";
if (counter < 5 && m < 10) {
System.out.println("Get row " + counter + " column '" + field.getName() + "' value: " + fieldValue);
}
if (fieldValue != null)
getHllc(m).add(Bytes.toBytes(fieldValue.toString())); |
<<<<<<<
import java.sql.SQLException;
=======
import java.util.Collections;
import java.util.List;
>>>>>>>
import java.sql.SQLException;
import java.util.Collections;
import java.util.List; |
<<<<<<<
import org.apache.hadoop.mapreduce.Mapper;
import org.apache.hive.hcatalog.data.HCatRecord;
import org.apache.hive.hcatalog.data.schema.HCatFieldSchema;
import org.apache.hive.hcatalog.data.schema.HCatSchema;
import org.apache.hive.hcatalog.mapreduce.HCatInputFormat;
=======
>>>>>>>
import org.apache.hive.hcatalog.data.HCatRecord;
import org.apache.hive.hcatalog.data.schema.HCatFieldSchema;
import org.apache.hive.hcatalog.data.schema.HCatSchema;
import org.apache.hive.hcatalog.mapreduce.HCatInputFormat;
<<<<<<<
public class FactDistinctColumnsMapper<KEYIN> extends Mapper<KEYIN, HCatRecord, ShortWritable, Text> {
=======
public class FactDistinctColumnsMapper<KEYIN> extends KylinMapper<KEYIN, Text, ShortWritable, Text> {
>>>>>>>
public class FactDistinctColumnsMapper<KEYIN> extends KylinMapper<KEYIN, HCatRecord, ShortWritable, Text> { |
<<<<<<<
import com.kylinolap.dict.Dictionary;
import com.kylinolap.metadata.model.ColumnDesc;
import com.kylinolap.metadata.model.TableDesc;
import com.kylinolap.metadata.model.realization.TblColRef;
=======
import com.kylinolap.metadata.model.cube.TblColRef;
import com.kylinolap.metadata.model.schema.ColumnDesc;
import com.kylinolap.metadata.model.schema.TableDesc;
>>>>>>>
import com.kylinolap.metadata.model.ColumnDesc;
import com.kylinolap.metadata.model.TableDesc;
import com.kylinolap.metadata.model.realization.TblColRef; |
<<<<<<<
long startTimestamp = cubeInstance.getDateRangeEnd() == 0 ? TimeUtil.getNextPeriodStart(System.currentTimeMillis(), (long) batchInterval) : cubeInstance.getDateRangeEnd();
=======
MicroBatchCondition condition = new MicroBatchCondition(Integer.MAX_VALUE, batchInterval);
long startTimestamp = cubeInstance.getDateRangeEnd() == 0 ? TimeUtil.getNextPeriodStart(System.currentTimeMillis() - 30 * 60 * 1000, (long) batchInterval) : cubeInstance.getDateRangeEnd();
>>>>>>>
long startTimestamp = cubeInstance.getDateRangeEnd() == 0 ? TimeUtil.getNextPeriodStart(System.currentTimeMillis() - 30 * 60 * 1000, (long) batchInterval) : cubeInstance.getDateRangeEnd(); |
<<<<<<<
@Override
public int getColumnLength(TblColRef col) {
Dictionary<?> dict = getDictionary(col);
if (dict == null) {
return this.getCubeDesc().getRowkey().getColumnLength(col);
} else {
return dict.getSizeOfId();
}
}
@Override
public Dictionary<?> getDictionary(TblColRef col) {
return CubeManager.getInstance(this.getCubeInstance().getConfig()).getDictionary(this, col);
}
public void setDictionaries(ConcurrentHashMap<String, String> dictionaries) {
this.dictionaries = dictionaries;
}
public void setSnapshots(ConcurrentHashMap<String, String> snapshots) {
this.snapshots = snapshots;
}
=======
>>>>>>>
public void setDictionaries(ConcurrentHashMap<String, String> dictionaries) {
this.dictionaries = dictionaries;
}
public void setSnapshots(ConcurrentHashMap<String, String> snapshots) {
this.snapshots = snapshots;
} |
<<<<<<<
import com.kylinolap.job2.cube.BuildCubeJob;
import com.kylinolap.job2.cube.BuildCubeJobBuilder;
=======
import com.kylinolap.job2.cube.CubingJob;
import com.kylinolap.job2.cube.CubingJobBuilder;
>>>>>>>
import com.kylinolap.job2.cube.CubingJob;
import com.kylinolap.job2.cube.CubingJobBuilder;
<<<<<<<
=======
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.stereotype.Component;
import com.kylinolap.cube.CubeInstance;
import com.kylinolap.cube.CubeSegment;
import com.kylinolap.cube.exception.CubeIntegrityException;
import com.kylinolap.cube.model.CubeBuildTypeEnum;
import com.kylinolap.job.JobInstance;
import com.kylinolap.job.constant.JobStatusEnum;
import com.kylinolap.job.exception.InvalidJobInstanceException;
import com.kylinolap.job.exception.JobException;
>>>>>>> |
<<<<<<<
import org.apache.hadoop.hbase.io.ImmutableBytesWritable;
=======
import org.apache.hadoop.hbase.KeyValue;
import org.apache.hadoop.io.IOUtils;
>>>>>>>
import org.apache.hadoop.hbase.KeyValue;
<<<<<<<
=======
options.addOption(OPTION_STATISTICS_ENABLED);
options.addOption(OPTION_CUBOID_MODE);
>>>>>>>
options.addOption(OPTION_CUBOID_MODE);
<<<<<<<
final Map<Long, Double> cuboidSizeMap = new CubeStatsReader(cubeSegment, kylinConfig).getCuboidSizeMap();
splitKeys = getRegionSplitsFromCuboidStatistics(cuboidSizeMap, kylinConfig, cubeSegment,
partitionFilePath.getParent());
=======
if (statsEnabled) {
Map<Long, Double> cuboidSizeMap = new CubeStatsReader(cubeSegment, null, kylinConfig).getCuboidSizeMap();
Set<Long> buildingCuboids = cube.getCuboidsByMode(cuboidModeName);
if (buildingCuboids != null && !buildingCuboids.isEmpty()) {
Map<Long, Double> optimizedCuboidSizeMap = Maps.newHashMapWithExpectedSize(buildingCuboids.size());
for (Long cuboid : buildingCuboids) {
Double cuboidSize = cuboidSizeMap.get(cuboid);
if (cuboidSize == null) {
logger.warn(cuboid + "cuboid's size is null will replace by 0");
cuboidSize = 0.0;
}
optimizedCuboidSizeMap.put(cuboid, cuboidSize);
}
cuboidSizeMap = optimizedCuboidSizeMap;
}
splitKeys = getRegionSplitsFromCuboidStatistics(cuboidSizeMap, kylinConfig, cubeSegment, partitionFilePath.getParent());
} else {
splitKeys = getRegionSplits(conf, partitionFilePath);
}
>>>>>>>
Map<Long, Double> cuboidSizeMap = new CubeStatsReader(cubeSegment, kylinConfig).getCuboidSizeMap();
// for cube planner, will keep cuboidSizeMap unchanged if cube planner is disabled
Set<Long> buildingCuboids = cube.getCuboidsByMode(cuboidModeName);
if (buildingCuboids != null && !buildingCuboids.isEmpty()) {
Map<Long, Double> optimizedCuboidSizeMap = Maps.newHashMapWithExpectedSize(buildingCuboids.size());
for (Long cuboid : buildingCuboids) {
Double cuboidSize = cuboidSizeMap.get(cuboid);
if (cuboidSize == null) {
logger.warn(cuboid + "cuboid's size is null will replace by 0");
cuboidSize = 0.0;
}
optimizedCuboidSizeMap.put(cuboid, cuboidSize);
}
cuboidSizeMap = optimizedCuboidSizeMap;
}
splitKeys = getRegionSplitsFromCuboidStatistics(cuboidSizeMap, kylinConfig, cubeSegment,
partitionFilePath.getParent()); |
<<<<<<<
import org.apache.hadoop.mapreduce.Mapper;
import org.apache.hive.hcatalog.data.HCatRecord;
import org.apache.hive.hcatalog.data.schema.HCatFieldSchema;
import org.apache.hive.hcatalog.data.schema.HCatSchema;
import org.apache.hive.hcatalog.mapreduce.HCatInputFormat;
=======
import org.apache.hadoop.io.Text;
>>>>>>>
import org.apache.hive.hcatalog.data.HCatRecord;
import org.apache.hive.hcatalog.data.schema.HCatFieldSchema;
import org.apache.hive.hcatalog.data.schema.HCatSchema;
import org.apache.hive.hcatalog.mapreduce.HCatInputFormat;
<<<<<<<
import com.kylinolap.invertedindex.IIInstance;
import com.kylinolap.invertedindex.IIManager;
import com.kylinolap.invertedindex.IISegment;
import com.kylinolap.invertedindex.index.TableRecord;
import com.kylinolap.invertedindex.index.TableRecordInfo;
=======
import com.kylinolap.common.mr.KylinMapper;
import com.kylinolap.common.util.BytesSplitter;
import com.kylinolap.common.util.SplittedBytes;
>>>>>>>
import com.kylinolap.common.mr.KylinMapper;
import com.kylinolap.invertedindex.IIInstance;
import com.kylinolap.invertedindex.IIManager;
import com.kylinolap.invertedindex.IISegment;
import com.kylinolap.invertedindex.index.TableRecord;
import com.kylinolap.invertedindex.index.TableRecordInfo;
<<<<<<<
public class InvertedIndexMapper<KEYIN> extends Mapper<KEYIN, HCatRecord, LongWritable, ImmutableBytesWritable> {
=======
public class InvertedIndexMapper<KEYIN> extends KylinMapper<KEYIN, Text, LongWritable, ImmutableBytesWritable> {
>>>>>>>
public class InvertedIndexMapper<KEYIN> extends KylinMapper<KEYIN, HCatRecord, LongWritable, ImmutableBytesWritable> { |
<<<<<<<
import org.n52.iceland.i18n.I18NDAORepository;
import org.n52.iceland.i18n.LocaleHelper;
import org.n52.iceland.ogc.ows.ServiceMetadataRepository;
=======
>>>>>>>
import org.n52.iceland.i18n.I18NDAORepository;
<<<<<<<
Locale locale = LocaleHelper.fromString(request.getRequestedLanguage());
so = HibernateObservationUtilities.createSosObservationsFromObservations(oberservations, getRequest(request), serviceProvider, locale, i18NDAORepository, session).iterator().next();
=======
Locale locale = getRequestedLocale(request);
so = HibernateObservationUtilities.createSosObservationsFromObservations(oberservations, getRequest(request), serviceProvider, locale, null, daoFactory, session).iterator().next();
>>>>>>>
Locale locale = getRequestedLocale(request);
so = HibernateObservationUtilities.createSosObservationsFromObservations(oberservations, getRequest(request), serviceProvider, locale, null, null, daoFactory, session).iterator().next(); |
<<<<<<<
@Override
public void setComponentWizardPage(IComponentWizardPage componentWizardPage) {
=======
public final void setComponentWizardPage(IComponentWizardPage componentWizardPage) {
>>>>>>>
@Override
public final void setComponentWizardPage(IComponentWizardPage componentWizardPage) {
<<<<<<<
@Deprecated
protected final void createPackageNamesGrp(Composite composite) {
Group grpPackage = new Group(composite, SWT.NONE);
grpPackage.setText("Package");
grpPackage.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
grpPackage.setLayout(new GridLayout(5, false));
Label lblEndpoint = new Label(grpPackage, SWT.NONE);
lblEndpoint.setText("Name:");
lblEndpoint.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false, 1, 0));
cmbPackageNames = new Combo(grpPackage, SWT.BORDER | SWT.READ_ONLY);
cmbPackageNames.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, true, false, 4, 0));
cmbPackageNames.addSelectionListener(new SelectionListener() {
@Override
public void widgetDefaultSelected(SelectionEvent e) {
getComponentWizardPage().validateUserInput();
}
@Override
public void widgetSelected(SelectionEvent e) {
widgetDefaultSelected(e);
}
});
}
protected Group createPropertiesGroup(Composite composite) {
=======
protected final Group createPropertiesGroup(Composite composite) {
>>>>>>>
protected final Group createPropertiesGroup(Composite composite) {
<<<<<<<
@Override
public void modifyText(ModifyEvent e) {
=======
public final void modifyText(ModifyEvent e) {
>>>>>>>
@Override
public final void modifyText(ModifyEvent e) {
<<<<<<<
@Override
public void modifyText(ModifyEvent e) {
=======
public final void modifyText(ModifyEvent e) {
>>>>>>>
@Override
public final void modifyText(ModifyEvent e) {
<<<<<<<
@Override
public void modifyText(ModifyEvent e) {
=======
public final void modifyText(ModifyEvent e) {
>>>>>>>
@Override
public final void modifyText(ModifyEvent e) {
<<<<<<<
@Override
public void modifyText(ModifyEvent e) {
=======
public final void modifyText(ModifyEvent e) {
>>>>>>>
@Override
public final void modifyText(ModifyEvent e) {
<<<<<<<
@Override
public void modifyText(ModifyEvent e) {
=======
public final void modifyText(ModifyEvent e) {
>>>>>>>
@Override
public final void modifyText(ModifyEvent e) {
<<<<<<<
@Override
public void modifyText(ModifyEvent e) {
=======
public final void modifyText(ModifyEvent e) {
>>>>>>>
@Override
public final void modifyText(ModifyEvent e) {
<<<<<<<
@Override
public void modifyText(ModifyEvent e) {
=======
public final void modifyText(ModifyEvent e) {
>>>>>>>
@Override
public final void modifyText(ModifyEvent e) {
<<<<<<<
@Override
public void widgetDefaultSelected(SelectionEvent e) {
=======
public final void widgetDefaultSelected(SelectionEvent e) {
>>>>>>>
@Override
public final void widgetDefaultSelected(SelectionEvent e) {
<<<<<<<
@Override
public void widgetSelected(SelectionEvent e) {
=======
public final void widgetSelected(SelectionEvent e) {
>>>>>>>
@Override
public final void widgetSelected(SelectionEvent e) {
<<<<<<<
@Override
public void disableAllControls() {
disableComponentNameFields();
if (cmbPackageNames != null) {
cmbPackageNames.setEnabled(false);
}
if (cmbProjectNames != null) {
cmbProjectNames.setEnabled(false);
}
=======
@Override
public void setEnabled(boolean enabled) {
>>>>>>>
@Override
public void setEnabled(boolean enabled) {
<<<<<<<
@Override
public Text getTxtName() {
=======
public final Text getTxtName() {
>>>>>>>
@Override
public final Text getTxtName() {
<<<<<<<
@Override
public String getComponentName() {
=======
public final String getComponentName() {
>>>>>>>
@Override
public final String getComponentName() {
<<<<<<<
@Override
public String getNameString() {
=======
public final String getNameString() {
>>>>>>>
@Override
public final String getNameString() {
<<<<<<<
@Override
public String getLabelString() {
=======
public final String getLabelString() {
>>>>>>>
@Override
public final String getLabelString() {
<<<<<<<
@Override
public void disableComponentNameFields() {
txtName.setEnabled(false);
if (txtLabel != null) {
txtLabel.setEnabled(false);
}
if (txtPluralLabel != null) {
txtPluralLabel.setEnabled(false);
}
}
@Override
@Deprecated
public void disableComponentPackageNameField() {
cmbPackageNames.setEnabled(false);
}
@Override
@Deprecated
public String getPackageName() {
return Utils.isEmpty(getText(cmbPackageNames)) ? Constants.EMPTY_STRING : getText(cmbPackageNames);
}
@Override
@Deprecated
public Combo getCmbPackageName() {
return cmbPackageNames;
}
public void setPackageName(String packageName) {
selectComboContent(packageName, cmbPackageNames);
}
public String getObject() {
=======
public final String getObject() {
>>>>>>>
public final String getObject() {
<<<<<<<
@Override
public Combo getCmbTemplateNames() {
=======
public final Combo getCmbTemplateNames() {
>>>>>>>
@Override
public final Combo getCmbTemplateNames() { |
<<<<<<<
final ComponentModel model = getComponentWizardModel();
if ((selection == null || selection.getFirstElement() == null) && model != null && model.getProject() == null) {
logger.warn("Unable to open new component wizard - project is null.");
Utils.openWarn(null, UIMessages.getString("NewComponentAction.MessageBox.title"),
UIMessages.getString("NewComponentAction.UnknownFolder.message"));
return;
}
final Object obj = selection.getFirstElement();
final IProject project = obj instanceof IResource ? ((IResource) obj).getProject() : null;
=======
>>>>>>>
<<<<<<<
getComponentController().setResources(project);
=======
if (null != selection) {
Object obj = selection.getFirstElement();
if (obj instanceof IResource) {
IProject project = ((IResource) obj).getProject();
getComponentController().setResources(null, project);
}
}
>>>>>>>
if (null != selection) {
Object obj = selection.getFirstElement();
if (obj instanceof IResource) {
IProject project = ((IResource) obj).getProject();
getComponentController().setResources(project);
}
} |
<<<<<<<
=======
private BrowserLauncher launcher = null;
private String screenshotRepositoryPath;
>>>>>>>
private String screenshotRepositoryPath;
<<<<<<<
String link = "http://www.quaddicted.com/reviews/" + e.getDescription();
BrowserLauncher.openURL(link);
=======
String link = "https://www.quaddicted.com/reviews/" + e.getDescription();
launcher.openURLinBrowser(link);
>>>>>>>
String link = "https://www.quaddicted.com/reviews/" + e.getDescription();
BrowserLauncher.openURL(link); |
<<<<<<<
=======
import javax.naming.InitialContext;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.transaction.UserTransaction;
>>>>>>>
import org.jbpm.shared.services.impl.JbpmServicesPersistenceManagerImpl;
import javax.naming.InitialContext;
import javax.persistence.EntityManager;
import javax.transaction.UserTransaction;
<<<<<<<
import org.jbpm.shared.services.api.JbpmServicesPersistenceManager;
=======
import org.jbpm.shared.services.cdi.Startup;
>>>>>>>
import org.jbpm.shared.services.api.JbpmServicesPersistenceManager;
import org.jbpm.shared.services.cdi.Startup;
<<<<<<<
setValidStatuses();
// long now = System.currentTimeMillis();
// List<DeadlineSummary> resultList = em.createNamedQuery("UnescalatedDeadlines").getResultList();
// for (DeadlineSummary summary : resultList) {
// long delay = summary.getDate().getTime() - now;
// schedule(summary.getTaskId(), summary.getDeadlineId(), delay);
// }
}
private void executeEscalatedDeadline(long taskId, long deadlineId) {
Task task = (Task) pm.find(Task.class, taskId);
Deadline deadline = (Deadline) pm.find(Deadline.class, deadlineId);
TaskData taskData = task.getTaskData();
Content content = null;
if (taskData != null) {
content = (Content) pm.find(Content.class, taskData.getDocumentContentId());
=======
UserTransaction ut = setupEnvironment();
EntityManager entityManager = getEntityManager();
long now = System.currentTimeMillis();
List<DeadlineSummary> resultList = entityManager.createNamedQuery("UnescalatedStartDeadlines").getResultList();
for (DeadlineSummary summary : resultList) {
long delay = summary.getDate().getTime() - now;
schedule(summary.getTaskId(), summary.getDeadlineId(), delay, DeadlineType.START);
>>>>>>>
// UserTransaction ut = setupEnvironment();
long now = System.currentTimeMillis();
List<DeadlineSummary> resultList = (List<DeadlineSummary>)pm.queryInTransaction("UnescalatedStartDeadlines");
for (DeadlineSummary summary : resultList) {
long delay = summary.getDate().getTime() - now;
schedule(summary.getTaskId(), summary.getDeadlineId(), delay, DeadlineType.START); |
<<<<<<<
if( task.getDeadlines() != null ){
final List<Deadline> startDeadlines = task.getDeadlines().getStartDeadlines();
if (startDeadlines != null) {
scheduleDeadlines(startDeadlines, now, task.getId());
}
final List<Deadline> endDeadlines = task.getDeadlines().getEndDeadlines();
if (endDeadlines != null) {
scheduleDeadlines(endDeadlines, now, task.getId());
}
=======
Deadlines deadlines = task.getDeadlines();
if (deadlines != null) {
final List<Deadline> startDeadlines = deadlines.getStartDeadlines();
if (startDeadlines != null) {
scheduleDeadlines(startDeadlines, now, task.getId(), DeadlineType.START);
}
final List<Deadline> endDeadlines = deadlines.getEndDeadlines();
if (endDeadlines != null) {
scheduleDeadlines(endDeadlines, now, task.getId(), DeadlineType.END);
}
>>>>>>>
Deadlines deadlines = task.getDeadlines();
if (deadlines != null) {
final List<Deadline> startDeadlines = deadlines.getStartDeadlines();
if (startDeadlines != null) {
scheduleDeadlines(startDeadlines, now, task.getId(), DeadlineType.START);
}
final List<Deadline> endDeadlines = deadlines.getEndDeadlines();
if (endDeadlines != null) {
scheduleDeadlines(endDeadlines, now, task.getId(), DeadlineType.END);
}
<<<<<<<
if (task.getDeadlines().getStartDeadlines() != null) {
it = task.getDeadlines().getStartDeadlines().iterator();
while (it.hasNext()) {
pm.remove(it.next());
it.remove();
=======
if (removeStart) {
if (task.getDeadlines().getStartDeadlines() != null) {
it = task.getDeadlines().getStartDeadlines().iterator();
while (it.hasNext()) {
deadlineService.unschedule(taskId, DeadlineType.START);
em.remove(it.next());
it.remove();
}
>>>>>>>
if (removeStart) {
if (task.getDeadlines().getStartDeadlines() != null) {
it = task.getDeadlines().getStartDeadlines().iterator();
while (it.hasNext()) {
deadlineService.unschedule(taskId, DeadlineType.START);
pm.remove(it.next());
it.remove();
}
<<<<<<<
if (task.getDeadlines().getEndDeadlines() != null) {
it = task.getDeadlines().getEndDeadlines().iterator();
while (it.hasNext()) {
pm.remove(it.next());
it.remove();
=======
if (removeEnd) {
if (task.getDeadlines().getEndDeadlines() != null) {
it = task.getDeadlines().getEndDeadlines().iterator();
while (it.hasNext()) {
deadlineService.unschedule(taskId, DeadlineType.END);
em.remove(it.next());
it.remove();
}
>>>>>>>
if (removeEnd) {
if (task.getDeadlines().getEndDeadlines() != null) {
it = task.getDeadlines().getEndDeadlines().iterator();
while (it.hasNext()) {
deadlineService.unschedule(taskId, DeadlineType.END);
pm.remove(it.next());
it.remove();
} |
<<<<<<<
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
=======
import java.io.ByteArrayInputStream;
>>>>>>>
import java.io.ByteArrayInputStream;
import java.io.InputStreamReader;
<<<<<<<
private KnowledgeBase createKnowledgeBaseWithoutDumper(String process) throws Exception {
KnowledgeBuilderConfiguration conf = KnowledgeBuilderFactory.newKnowledgeBuilderConfiguration();
((PackageBuilderConfiguration) conf).initSemanticModules();
((PackageBuilderConfiguration) conf).addSemanticModule(new BPMNSemanticModule());
((PackageBuilderConfiguration) conf).addSemanticModule(new BPMNDISemanticModule());
((PackageBuilderConfiguration) conf).addSemanticModule(new BPMNExtensionsSemanticModule());
// ProcessDialectRegistry.setDialect("XPath", new XPathDialect());
XmlProcessReader processReader = new XmlProcessReader(
((PackageBuilderConfiguration) conf).getSemanticModules());
KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder(conf);
kbuilder.add(ResourceFactory.newReaderResource(new InputStreamReader(SimpleBPMNProcessTest.class.getResourceAsStream("/" + process))), ResourceType.BPMN2);
if (!kbuilder.getErrors().isEmpty()) {
for (KnowledgeBuilderError error: kbuilder.getErrors()) {
System.err.println(error);
}
throw new IllegalArgumentException("Errors while parsing knowledge base");
}
KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase();
kbase.addKnowledgePackages(kbuilder.getKnowledgePackages());
return kbase;
}
private StatefulKnowledgeSession createKnowledgeSession(KnowledgeBase kbase) {
// Environment env = KnowledgeBaseFactory.newEnvironment();
// Properties properties = new Properties();
// properties.put("drools.processInstanceManagerFactory", "org.jbpm.process.instance.impl.DefaultProcessInstanceManagerFactory");
// properties.put("drools.processSignalManagerFactory", "org.jbpm.process.instance.event.DefaultSignalManagerFactory");
// KnowledgeSessionConfiguration config = KnowledgeBaseFactory.newKnowledgeSessionConfiguration(properties);
// return kbase.newStatefulKnowledgeSession(config, env);
Environment env = KnowledgeBaseFactory.newEnvironment();
env.set(EnvironmentName.ENTITY_MANAGER_FACTORY, emf);
env.set(EnvironmentName.TRANSACTION_MANAGER,
TransactionManagerServices.getTransactionManager());
Properties properties = new Properties();
properties.put("drools.processInstanceManagerFactory", "org.jbpm.persistence.processinstance.JPAProcessInstanceManagerFactory");
properties.put("drools.processSignalManagerFactory", "org.jbpm.persistence.processinstance.JPASignalManagerFactory");
KnowledgeSessionConfiguration config = KnowledgeBaseFactory.newKnowledgeSessionConfiguration(properties);
return JPAKnowledgeService.newStatefulKnowledgeSession(kbase, config, env);
}
private StatefulKnowledgeSession restoreSession(StatefulKnowledgeSession ksession) {
// return ksession;
int id = ksession.getId();
KnowledgeBase kbase = ksession.getKnowledgeBase();
Environment env = ksession.getEnvironment();
KnowledgeSessionConfiguration config = ksession.getSessionConfiguration();
return JPAKnowledgeService.loadStatefulKnowledgeSession(id, kbase, config, env);
}
private void assertProcessInstanceCompleted(long processInstanceId, StatefulKnowledgeSession ksession) {
assertNull(ksession.getProcessInstance(processInstanceId));
}
private void assertProcessInstanceAborted(long processInstanceId, StatefulKnowledgeSession ksession) {
assertNull(ksession.getProcessInstance(processInstanceId));
}
private void assertProcessInstanceActive(long processInstanceId, StatefulKnowledgeSession ksession) {
assertNotNull(ksession.getProcessInstance(processInstanceId));
}
private static class TestWorkItemHandler implements WorkItemHandler {
private WorkItem workItem;
public void executeWorkItem(WorkItem workItem, WorkItemManager manager) {
this.workItem = workItem;
}
public void abortWorkItem(WorkItem workItem, WorkItemManager manager) {
}
public WorkItem getWorkItem() {
WorkItem result = this.workItem;
this.workItem = null;
return result;
}
}
=======
>>>>>>>
private KnowledgeBase createKnowledgeBaseWithoutDumper(String process) throws Exception {
KnowledgeBuilderConfiguration conf = KnowledgeBuilderFactory.newKnowledgeBuilderConfiguration();
((PackageBuilderConfiguration) conf).initSemanticModules();
((PackageBuilderConfiguration) conf).addSemanticModule(new BPMNSemanticModule());
((PackageBuilderConfiguration) conf).addSemanticModule(new BPMNDISemanticModule());
((PackageBuilderConfiguration) conf).addSemanticModule(new BPMNExtensionsSemanticModule());
// ProcessDialectRegistry.setDialect("XPath", new XPathDialect());
XmlProcessReader processReader = new XmlProcessReader(
((PackageBuilderConfiguration) conf).getSemanticModules());
KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder(conf);
kbuilder.add(ResourceFactory.newReaderResource(new InputStreamReader(SimpleBPMNProcessTest.class.getResourceAsStream("/" + process))), ResourceType.BPMN2);
if (!kbuilder.getErrors().isEmpty()) {
for (KnowledgeBuilderError error: kbuilder.getErrors()) {
System.err.println(error);
}
throw new IllegalArgumentException("Errors while parsing knowledge base");
}
KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase();
kbase.addKnowledgePackages(kbuilder.getKnowledgePackages());
return kbase;
} |
<<<<<<<
import org.drools.core.util.StringUtils;
import org.jbpm.shared.services.api.JbpmServicesPersistenceManager;
=======
>>>>>>>
<<<<<<<
public class UserGroupLifeCycleManagerDecorator implements LifeCycleManager {
=======
public abstract class UserGroupLifeCycleManagerDecorator extends AbstractUserGroupCallbackDecorator implements LifeCycleManager {
>>>>>>>
public class UserGroupLifeCycleManagerDecorator extends AbstractUserGroupCallbackDecorator implements LifeCycleManager {
<<<<<<<
@Inject
private JbpmServicesPersistenceManager pm;
@Inject
private UserGroupCallback userGroupCallback;
private Map<String, Boolean> userGroupsMap = new HashMap<String, Boolean>();
=======
>>>>>>>
<<<<<<<
private List<String> doUserGroupCallbackOperation(String userId, List<String> groupIds) {
doCallbackUserOperation(userId);
doCallbackGroupsOperation(userId, groupIds);
return userGroupCallback.getGroupsForUser(userId, groupIds, null);
}
private boolean doCallbackUserOperation(String userId) {
if (userId != null && userGroupCallback.existsUser(userId)) {
addUserFromCallbackOperation(userId);
return true;
}
return false;
}
private boolean doCallbackGroupOperation(String groupId) {
if (groupId != null && userGroupCallback.existsGroup(groupId)) {
addGroupFromCallbackOperation(groupId);
return true;
}
return false;
}
private void addUserFromCallbackOperation(String userId) {
try {
boolean userExists = pm.find(User.class, userId) != null;
if (!StringUtils.isEmpty(userId) && !userExists) {
User user = new User(userId);
pm.persist(user);
}
} catch (Throwable t) {
//logger.log(Level.SEVERE, "Unable to add user " + userId);
}
}
private void doCallbackGroupsOperation(String userId, List<String> groupIds) {
if (userId != null) {
if (groupIds != null && groupIds.size() > 0) {
List<String> userGroups = userGroupCallback.getGroupsForUser(userId, groupIds, null);
for (String groupId : groupIds) {
if (userGroupCallback.existsGroup(groupId) && userGroups != null && userGroups.contains(groupId)) {
addGroupFromCallbackOperation(groupId);
}
}
} else {
if (!(userGroupsMap.containsKey(userId) && userGroupsMap.get(userId).booleanValue())) {
List<String> userGroups = userGroupCallback.getGroupsForUser(userId, null, null);
if (userGroups != null && userGroups.size() > 0) {
for (String group : userGroups) {
addGroupFromCallbackOperation(group);
}
userGroupsMap.put(userId, true);
}
}
}
} else {
if (groupIds != null) {
for (String groupId : groupIds) {
addGroupFromCallbackOperation(groupId);
}
}
}
}
private void addGroupFromCallbackOperation(String groupId) {
try {
boolean groupExists = pm.find(Group.class, groupId) != null;
if (!StringUtils.isEmpty(groupId) && !groupExists) {
Group group = new Group(groupId);
pm.persist(group);
}
} catch (Throwable t) {
//logger.log(Level.WARNING, "UserGroupCallback has not been registered.");
}
}
=======
>>>>>>> |
<<<<<<<
import javax.persistence.EntityManager;
import org.drools.core.util.StringUtils;
import org.jbpm.shared.services.api.JbpmServicesPersistenceManager;
=======
>>>>>>>
<<<<<<<
@Inject
private UserGroupCallback userGroupCallback;
@Inject
private JbpmServicesPersistenceManager pm;
=======
>>>>>>>
<<<<<<<
private boolean doCallbackUserOperation(String userId) {
if (userId != null && userGroupCallback.existsUser(userId)) {
addUserFromCallbackOperation(userId);
return true;
}
return false;
}
private void addUserFromCallbackOperation(String userId) {
try {
boolean userExists = pm.find(User.class, userId) != null;
if (!StringUtils.isEmpty(userId) && !userExists) {
User user = new User(userId);
pm.persist(user);
}
} catch (Throwable t) {
//logger.log(Level.SEVERE, "Unable to add user " + userId);
}
}
=======
>>>>>>> |
<<<<<<<
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import static org.junit.Assert.*;
=======
import java.io.InputStream;
import org.drools.template.model.Package;
import org.junit.Ignore;
import org.junit.Test;
import junit.framework.TestCase;
>>>>>>>
import java.io.InputStream;
import org.drools.template.model.Package;
import org.junit.Ignore;
import org.junit.Test;
import static org.junit.Assert.*;
<<<<<<<
/**
* Tests parsing a large spreadsheet into an in memory ruleset. This doesn't
* really do anything much at present. Takes a shed-load of memory to dump
* out this much XML as a string, so really should think of using a stream
* in some cases... (tried StringWriter, but is still in memory, so doesn't
* help).
*
* Stream to a temp file would work: return a stream from that file
* (decorate FileInputStream such that when you close it, it deletes the
* temp file).... must be other options.
*
* @throws Exception
*/
@Test
public void testLargeWorkSheetParseToRuleset() throws Exception {
// Test removed until have streaming sorted in future. No one using Uber Tables just yet !
// InputStream stream = RuleWorksheetParseLargeTest.class.getResourceAsStream( "/data/VeryLargeWorkbook.xls" );
//
// startTimer( );
// RuleSheetListener listener = RuleWorksheetParseTest.getRuleSheetListener( stream );
// stopTimer( );
//
// System.out.println( "Time to parse large table : " + getTime( ) );
// Ruleset ruleset = listener.getRuleSet( );
// assertNotNull( ruleset );
/*
* System.out.println("Time taken for 20K rows parsed: " + getTime());
*
* startTimer(); String xml = listener.getRuleSet().toXML();
* stopTimer(); System.out.println("Time taken for rendering to XML: " +
* getTime());
*/
}
=======
private void stopTimer() {
this.endTimer = System.currentTimeMillis();
}
>>>>>>>
private void stopTimer() {
this.endTimer = System.currentTimeMillis();
} |
<<<<<<<
public FieldTermsResponse fieldTerms(String field) throws IOException, APIException {
return ApiClient.get(FieldTermsResponse.class)
.path("/search/universal/{0}/terms", timeRange.getType().toString().toLowerCase())
.queryParam("field", field)
.queryParam("query", query)
.queryParams(timeRange.getQueryParams())
.execute();
}
=======
public interface Factory {
UniversalSearch queryWithRange(String query, TimeRange timeRange);
}
>>>>>>>
public FieldTermsResponse fieldTerms(String field) throws IOException, APIException {
return ApiClient.get(FieldTermsResponse.class)
.path("/search/universal/{0}/terms", timeRange.getType().toString().toLowerCase())
.queryParam("field", field)
.queryParam("query", query)
.queryParams(timeRange.getQueryParams())
.execute();
}
public interface Factory {
UniversalSearch queryWithRange(String query, TimeRange timeRange);
} |
<<<<<<<
import org.drools.core.util.StringUtils;
import org.jbpm.shared.services.api.JbpmServicesPersistenceManager;
=======
>>>>>>>
<<<<<<<
@Inject
private UserGroupCallback userGroupCallback;
@Inject
private JbpmServicesPersistenceManager pm;
=======
>>>>>>>
<<<<<<<
private boolean doCallbackUserOperation(String userId) {
if (userId != null && userGroupCallback.existsUser(userId)) {
addUserFromCallbackOperation(userId);
return true;
}
return false;
}
private void addUserFromCallbackOperation(String userId) {
try {
boolean userExists = pm.find(User.class, userId) != null;
if (!StringUtils.isEmpty(userId) && !userExists) {
User user = new User(userId);
pm.persist(user);
}
} catch (Throwable t) {
//logger.log(Level.SEVERE, "Unable to add user " + userId);
}
}
=======
>>>>>>> |
<<<<<<<
import me.itzsomebody.radon.transformers.obfuscators.InstructionSetReducer;
=======
import me.itzsomebody.radon.transformers.obfuscators.BadAnnotation;
>>>>>>>
import me.itzsomebody.radon.transformers.obfuscators.BadAnnotation;
import me.itzsomebody.radon.transformers.obfuscators.InstructionSetReducer;
<<<<<<<
CORRUPT_CRC(Boolean.class, null),
TRASH_CLASSES(Integer.class, null);
=======
TRASH_CLASSES(Integer.class, null),
BAD_ANNOTATION(Boolean.class, new BadAnnotation());
>>>>>>>
CORRUPT_CRC(Boolean.class, null),
TRASH_CLASSES(Integer.class, null),
BAD_ANNOTATION(Boolean.class, new BadAnnotation()); |
<<<<<<<
private SwingWorker<Map<String, List<Map<String, String>>>, Map<String, List<Map<String, String>>>> currentDataRequest;
private SwingWorker<Map<String, List<Map<String, String>>>, Map<String, List<Map<String, String>>>> currentPredictionRequest;
=======
SwingWorker<Map<String, List<Map<String, String>>>, Map<String, List<Map<String, String>>>> currentDataRequest;
SwingWorker<Map<String, List<Map<String, String>>>, Map<String, List<Map<String, String>>>> currentPredictionRequest;
private List<Runnable> feedCallbacks = new ArrayList<Runnable>();
>>>>>>>
private SwingWorker<Map<String, List<Map<String, String>>>, Map<String, List<Map<String, String>>>> currentDataRequest;
private SwingWorker<Map<String, List<Map<String, String>>>, Map<String, List<Map<String, String>>>> currentPredictionRequest;
private List<Runnable> feedCallbacks = new ArrayList<Runnable>();
<<<<<<<
plotDataFeedUpdateHandler.updateFromFeed(data, false);
=======
plotDataFedUpdateHandler.updateFromFeed(data, false);
for (Runnable r : feedCallbacks) {
SwingUtilities.invokeLater(r);
}
>>>>>>>
plotDataFeedUpdateHandler.updateFromFeed(data, false);
for (Runnable r : feedCallbacks) {
SwingUtilities.invokeLater(r);
} |
<<<<<<<
SwingUtilities.invokeLater(new Runnable() {
public void run() {
Mockito.when(feed1Component.getCapability(FeedProvider.class)).thenReturn(feed1);
Mockito.when(feed2Component.getCapability(FeedProvider.class)).thenReturn(feed2);
Mockito.when(feed3Component.getCapability(FeedProvider.class)).thenReturn(feed3);
Mockito.when(feed1Component.isLeaf()).thenReturn(true);
Mockito.when(feed2Component.isLeaf()).thenReturn(true);
Mockito.when(feed3Component.isLeaf()).thenReturn(true);
Mockito.when(feed1.getTimeService()).thenReturn(makeStaticTimeService(1));
Mockito.when(feed2.getTimeService()).thenReturn(makeStaticTimeService(2));
Mockito.when(feed3.getTimeService()).thenReturn(makeStaticTimeService(3));
Mockito.when(feed1.getSubscriptionId()).thenReturn("feed1");
Mockito.when(feed2.getSubscriptionId()).thenReturn("feed2");
Mockito.when(feed3.getSubscriptionId()).thenReturn("feed3");
TestersComponent component = new TestersComponent("x") {
@Override
public synchronized List<AbstractComponent> getComponents() {
return Arrays.asList(feed1Component, feed2Component, feed3Component);
}
};
PlotViewManifestation plot;
Mockito.when(feed1.isPrediction()).thenReturn(false);
Mockito.when(feed2.isPrediction()).thenReturn(false);
Mockito.when(feed3.isPrediction()).thenReturn(false);
plot = new PlotViewManifestation(component, new ViewInfo(PlotViewManifestation.class,"",ViewType.OBJECT));
Assert.assertEquals(plot.getCurrentMCTTime(), 1); // First non-predictive;
Mockito.when(feed1.isPrediction()).thenReturn(true);
Mockito.when(feed2.isPrediction()).thenReturn(false);
Mockito.when(feed3.isPrediction()).thenReturn(false);
plot = new PlotViewManifestation(component, new ViewInfo(PlotViewManifestation.class,"",ViewType.OBJECT));
Assert.assertEquals(plot.getCurrentMCTTime(), 2); // First non-predictive;
Mockito.when(feed1.isPrediction()).thenReturn(true);
Mockito.when(feed2.isPrediction()).thenReturn(true);
Mockito.when(feed3.isPrediction()).thenReturn(true);
plot = new PlotViewManifestation(component, new ViewInfo(PlotViewManifestation.class,"",ViewType.OBJECT));
Assert.assertEquals(plot.getCurrentMCTTime(), 1); // First non-predictive;
}
});
=======
Mockito.when(feed1Component.getCapability(FeedProvider.class)).thenReturn(feed1);
Mockito.when(feed2Component.getCapability(FeedProvider.class)).thenReturn(feed2);
Mockito.when(feed3Component.getCapability(FeedProvider.class)).thenReturn(feed3);
Mockito.when(feed1Component.isLeaf()).thenReturn(true);
Mockito.when(feed2Component.isLeaf()).thenReturn(true);
Mockito.when(feed3Component.isLeaf()).thenReturn(true);
Mockito.when(feed1.getTimeService()).thenReturn(this.makeStaticTimeService(1));
Mockito.when(feed2.getTimeService()).thenReturn(this.makeStaticTimeService(2));
Mockito.when(feed3.getTimeService()).thenReturn(this.makeStaticTimeService(3));
Mockito.when(feed1.getSubscriptionId()).thenReturn("feed1");
Mockito.when(feed2.getSubscriptionId()).thenReturn("feed2");
Mockito.when(feed3.getSubscriptionId()).thenReturn("feed3");
TestersComponent component = new TestersComponent("x") {
@Override
public synchronized List<AbstractComponent> getComponents() {
return Arrays.asList(feed1Component, feed2Component, feed3Component);
}
};
PlotViewManifestation plot;
Mockito.when(feed1.isPrediction()).thenReturn(p1);
Mockito.when(feed2.isPrediction()).thenReturn(p2);
Mockito.when(feed3.isPrediction()).thenReturn(p3);
plot = new PlotViewManifestation(component, new ViewInfo(PlotViewManifestation.class,"",ViewType.OBJECT));
Assert.assertEquals(plot.getCurrentMCTTime(), t); // First non-predictive;
}
@DataProvider
public Object[][] ingoresPredictiveTimeServiceTestCases() {
return new Object[][]{
{true,true,true,1},
{true,false,false,2},
{false,false,false,1}
};
>>>>>>>
Mockito.when(feed1Component.getCapability(FeedProvider.class)).thenReturn(feed1);
Mockito.when(feed2Component.getCapability(FeedProvider.class)).thenReturn(feed2);
Mockito.when(feed3Component.getCapability(FeedProvider.class)).thenReturn(feed3);
Mockito.when(feed1Component.isLeaf()).thenReturn(true);
Mockito.when(feed2Component.isLeaf()).thenReturn(true);
Mockito.when(feed3Component.isLeaf()).thenReturn(true);
Mockito.when(feed1.getTimeService()).thenReturn(makeStaticTimeService(1));
Mockito.when(feed2.getTimeService()).thenReturn(makeStaticTimeService(2));
Mockito.when(feed3.getTimeService()).thenReturn(makeStaticTimeService(3));
Mockito.when(feed1.getSubscriptionId()).thenReturn("feed1");
Mockito.when(feed2.getSubscriptionId()).thenReturn("feed2");
Mockito.when(feed3.getSubscriptionId()).thenReturn("feed3");
Mockito.when(feed1.isPrediction()).thenReturn(p1);
Mockito.when(feed2.isPrediction()).thenReturn(p2);
Mockito.when(feed3.isPrediction()).thenReturn(p3);
SwingUtilities.invokeLater(new Runnable() {
public void run() {
TestersComponent component = new TestersComponent("x") {
@Override
public synchronized List<AbstractComponent> getComponents() {
return Arrays.asList(feed1Component, feed2Component, feed3Component);
}
};
PlotViewManifestation plot;
plot = new PlotViewManifestation(component, new ViewInfo(PlotViewManifestation.class,"",ViewType.OBJECT));
Assert.assertEquals(plot.getCurrentMCTTime(), t); // First non-predictive;
}
});
}
@DataProvider
public Object[][] ingoresPredictiveTimeServiceTestCases() {
return new Object[][]{
{true,true,true,1},
{true,false,false,2},
{false,false,false,1}
}; |
<<<<<<<
=======
0.5,
0.5,
0.5,
0.0,
10.0,
now.getTimeInMillis(),
now.getTimeInMillis() + (5L * 60L * 1000L),
>>>>>>>
<<<<<<<
Color.white,
1,
=======
Color.white,
1,
0.5,
0.5,
0.5,
0,
10,
now.getTimeInMillis(),
now.getTimeInMillis() + (5L * 60L * 1000L),
>>>>>>>
Color.white,
1,
<<<<<<<
1,
=======
1,
0.5,
0.5,
0.5,
0,
10,
now.getTimeInMillis(),
now.getTimeInMillis() + (5L * 60L * 1000L),
>>>>>>>
1,
<<<<<<<
Assert.assertFalse(plot.isCompressionEnabled());
=======
Assert.assertFalse(plot.isCompresionEnabled());
now.add(Calendar.MINUTE, 1);
>>>>>>>
Assert.assertFalse(plot.isCompressionEnabled());
now.add(Calendar.MINUTE, 1);
<<<<<<<
=======
0.5,
0.5,
0.5,
0,
10,
now.getTimeInMillis(),
now.getTimeInMillis() + (5L * 60L * 1000L),
>>>>>>>
<<<<<<<
=======
0.5,
0.5,
0.5,
0,
10,
currentTime,
10,
>>>>>>> |
<<<<<<<
boolean checkMax = plot.getNonTimeAxisSubsequentMaxSetting() == NonTimeAxisSubsequentBoundsSetting.FIXED
|| plot.getNonTimeAxisSubsequentMaxSetting() == NonTimeAxisSubsequentBoundsSetting.SEMI_FIXED;
if(checkMax && (value >= plot.getMinNonTime() ||
nonTimeValueWithin1PixelOfLimit(value, plot.nonTimeAxisMaxPhysicalValue))) {
if (nonTimeMaxAlarm != LimitAlarmState.ALARM_OPENED_BY_USER && plot.isNonTimeMaxFixed()) {
=======
boolean checkMax = plot.nonTimeAxisMaxSubsequentSetting == NonTimeAxisSubsequentBoundsSetting.FIXED
|| plot.nonTimeAxisMaxSubsequentSetting == NonTimeAxisSubsequentBoundsSetting.SEMI_FIXED
|| plot.getNonTimeAxis().isPinned()
|| plot.plotAbstraction.getTimeAxisUserPin().isPinned()
|| plot.plotAbstraction.getTimeAxis().isPinned()
|| plot.plotAbstraction.getTimeAxis().isZoomed();
if(checkMax &&
(value >= plot.getCurrentNonTimeAxisMax()
|| nonTimeValueWithin1PixelOfLimit(value, plot.nonTimeAxisMaxPhysicalValue))
&& atTime >= plot.getCurrentTimeAxisMinAsLong() && atTime <= plot.getCurrentTimeAxisMaxAsLong()) {
if (nonTimeMaxAlarm != LimitAlarmState.ALARM_OPENED_BY_USER ) {
>>>>>>>
boolean checkMax = plot.getNonTimeAxisSubsequentMinSetting() == NonTimeAxisSubsequentBoundsSetting.FIXED
|| plot.getNonTimeAxisSubsequentMaxSetting() == NonTimeAxisSubsequentBoundsSetting.SEMI_FIXED
|| plot.getNonTimeAxis().isPinned()
|| plot.plotAbstraction.getTimeAxisUserPin().isPinned()
|| plot.plotAbstraction.getTimeAxis().isPinned()
|| plot.plotAbstraction.getTimeAxis().isZoomed();
if(checkMax &&
(value >= plot.getMaxNonTime()
|| nonTimeValueWithin1PixelOfLimit(value, plot.nonTimeAxisMaxPhysicalValue))
&& atTime >= plot.getMinTime() && atTime <= plot.getMaxTime()) {
if (nonTimeMaxAlarm != LimitAlarmState.ALARM_OPENED_BY_USER ) {
boolean wasOpen = nonTimeMaxAlarm == LimitAlarmState.ALARM_RAISED;
nonTimeMaxAlarm = LimitAlarmState.ALARM_RAISED;
maxAlarmMostRecentTime = atTime;
if(!wasOpen) {
addMaxAlertButton();
if(plot.getNonTimeAxisSubsequentMaxSetting() == NonTimeAxisSubsequentBoundsSetting.SEMI_FIXED &&
!plot.getNonTimeAxis().isPinned()) {
processMaxAlertButtonPress();
}
}
}
}
boolean checkMin = plot.getNonTimeAxisSubsequentMinSetting() == NonTimeAxisSubsequentBoundsSetting.FIXED
|| plot.getNonTimeAxisSubsequentMaxSetting() == NonTimeAxisSubsequentBoundsSetting.SEMI_FIXED
|| plot.getNonTimeAxis().isPinned()
|| plot.plotAbstraction.getTimeAxisUserPin().isPinned()
|| plot.plotAbstraction.getTimeAxis().isPinned()
|| plot.plotAbstraction.getTimeAxis().isZoomed();
if(checkMin && (value <= plot.getMinNonTime() ||
nonTimeValueWithin1PixelOfLimit(value, plot.nonTimeAxisMinPhysicalValue)) &&
atTime >= plot.getMinTime() && atTime <= plot.getMaxTime()) {
if (nonTimeMinAlarm != LimitAlarmState.ALARM_OPENED_BY_USER ) {
<<<<<<<
if(plot.getNonTimeAxisSubsequentMaxSetting() == NonTimeAxisSubsequentBoundsSetting.SEMI_FIXED) {
=======
if(plot.nonTimeAxisMaxSubsequentSetting == NonTimeAxisSubsequentBoundsSetting.SEMI_FIXED &&
!plot.getNonTimeAxis().isPinned()) {
>>>>>>>
if(plot.getNonTimeAxisSubsequentMaxSetting() == NonTimeAxisSubsequentBoundsSetting.SEMI_FIXED &&
!plot.getNonTimeAxis().isPinned()) {
<<<<<<<
}
boolean checkMin = plot.getNonTimeAxisSubsequentMinSetting() == NonTimeAxisSubsequentBoundsSetting.FIXED
|| plot.getNonTimeAxisSubsequentMinSetting() == NonTimeAxisSubsequentBoundsSetting.SEMI_FIXED;
if(checkMin && (value <= plot.getMinNonTime() ||
nonTimeValueWithin1PixelOfLimit(value, plot.nonTimeAxisMinPhysicalValue))) {
if (nonTimeMinAlarm != LimitAlarmState.ALARM_OPENED_BY_USER && plot.isNonTimeMinFixed()) {
=======
}
boolean checkMin = plot.nonTimeAxisMinSubsequentSetting == NonTimeAxisSubsequentBoundsSetting.FIXED
|| plot.nonTimeAxisMinSubsequentSetting == NonTimeAxisSubsequentBoundsSetting.SEMI_FIXED
|| plot.getNonTimeAxis().isPinned()
|| plot.plotAbstraction.getTimeAxisUserPin().isPinned()
|| plot.plotAbstraction.getTimeAxis().isPinned()
|| plot.plotAbstraction.getTimeAxis().isZoomed();
if(checkMin && (value <= plot.getCurrentNonTimeAxisMin() ||
nonTimeValueWithin1PixelOfLimit(value, plot.nonTimeAxisMinPhysicalValue)) &&
atTime >= plot.getCurrentTimeAxisMinAsLong() && atTime <= plot.getCurrentTimeAxisMaxAsLong()) {
if (nonTimeMinAlarm != LimitAlarmState.ALARM_OPENED_BY_USER ) {
>>>>>>>
}
boolean checkMin = plot.getNonTimeAxisSubsequentMinSetting() == NonTimeAxisSubsequentBoundsSetting.FIXED
|| plot.getNonTimeAxisSubsequentMaxSetting() == NonTimeAxisSubsequentBoundsSetting.SEMI_FIXED
|| plot.getNonTimeAxis().isPinned()
|| plot.plotAbstraction.getTimeAxisUserPin().isPinned()
|| plot.plotAbstraction.getTimeAxis().isPinned()
|| plot.plotAbstraction.getTimeAxis().isZoomed();
if(checkMin && (value <= plot.getMinNonTime() ||
nonTimeValueWithin1PixelOfLimit(value, plot.nonTimeAxisMinPhysicalValue)) &&
atTime >= plot.getMinTime() && atTime <= plot.getMaxTime()) {
if (nonTimeMinAlarm != LimitAlarmState.ALARM_OPENED_BY_USER ) {
<<<<<<<
if(plot.getNonTimeAxisSubsequentMinSetting() == NonTimeAxisSubsequentBoundsSetting.SEMI_FIXED) {
=======
if(plot.nonTimeAxisMinSubsequentSetting == NonTimeAxisSubsequentBoundsSetting.SEMI_FIXED &&
!plot.getNonTimeAxis().isPinned()) {
>>>>>>>
if(plot.getNonTimeAxisSubsequentMinSetting() == NonTimeAxisSubsequentBoundsSetting.SEMI_FIXED &&
!plot.getNonTimeAxis().isPinned()) { |
<<<<<<<
import es.usc.citius.servando.calendula.persistence.Medicine;
import es.usc.citius.servando.calendula.persistence.Patient;
=======
import es.usc.citius.servando.calendula.persistence.Medicine;
>>>>>>>
import es.usc.citius.servando.calendula.persistence.Medicine;
import es.usc.citius.servando.calendula.persistence.Patient;
<<<<<<<
public List<PatientAlert> findByPatientMedicineAndType(Patient p, Medicine m, PatientAlert.AlertType t) {
try {
final PreparedQuery<PatientAlert> query = this.queryBuilder().where()
.eq(PatientAlert.COLUMN_TYPE, t).and()
.eq(PatientAlert.COLUMN_PATIENT, p).and()
.eq(PatientAlert.COLUMN_MEDICINE, m).prepare();
return query(query);
} catch (SQLException e) {
Log.e(TAG, "findByPatientMedicineAndType: ", e);
return null;
}
}
=======
public List<PatientAlert> findByMedicineAndLevel(Medicine m, int level) {
try {
final PreparedQuery<PatientAlert> q = dao.queryBuilder().where()
.eq(PatientAlert.COLUMN_MEDICINE, m)
.and().eq(PatientAlert.COLUMN_LEVEL, level)
.prepare();
return dao.query(q);
} catch (SQLException e) {
Log.e(TAG, "findByMedicineAndLevel: ", e);
throw new RuntimeException("Cannot retrieve alerts: ", e);
}
}
>>>>>>>
public List<PatientAlert> findByMedicineAndLevel(Medicine m, int level) {
try {
final PreparedQuery<PatientAlert> q = dao.queryBuilder().where()
.eq(PatientAlert.COLUMN_MEDICINE, m)
.and().eq(PatientAlert.COLUMN_LEVEL, level)
.prepare();
return dao.query(q);
} catch (SQLException e) {
Log.e(TAG, "findByMedicineAndLevel: ", e);
throw new RuntimeException("Cannot retrieve alerts: ", e);
}
}
public List<PatientAlert> findByPatientMedicineAndType(Patient p, Medicine m, PatientAlert.AlertType t) {
try {
final PreparedQuery<PatientAlert> query = this.queryBuilder().where()
.eq(PatientAlert.COLUMN_TYPE, t).and()
.eq(PatientAlert.COLUMN_PATIENT, p).and()
.eq(PatientAlert.COLUMN_MEDICINE, m).prepare();
return query(query);
} catch (SQLException e) {
Log.e(TAG, "findByPatientMedicineAndType: ", e);
return null;
}
} |
<<<<<<<
public static final int ACTION_HOURLY_SCHEDULE_TIME = 6;
public static final int ACTION_HOURLY_SCHEDULE_DELAYED_TIME = 7;
public static final int ACTION_DELAY_HOURLY_SCHEDULE = 8;
public static final int ACTION_CANCEL_HOURLY_SCHEDULE = 9;
public static final int ACTION_CHECK_PICKUPS_ALARM = 10;
=======
public static final int ACTION_HOURLY_SCHEDULE_TIME = 6;
public static final int ACTION_HOURLY_SCHEDULE_DELAYED_TIME = 7;
public static final int ACTION_DELAY_HOURLY_SCHEDULE = 8;
public static final int ACTION_CANCEL_HOURLY_SCHEDULE = 9;
>>>>>>>
public static final int ACTION_HOURLY_SCHEDULE_TIME = 6;
public static final int ACTION_HOURLY_SCHEDULE_DELAYED_TIME = 7;
public static final int ACTION_DELAY_HOURLY_SCHEDULE = 8;
public static final int ACTION_CANCEL_HOURLY_SCHEDULE = 9;
public static final int ACTION_CHECK_PICKUPS_ALARM = 10;
<<<<<<<
DefaultDataGenerator.fillDBWithDummyData(getApplicationContext());
// initialize daily agenda
DailyAgenda.instance().setupForToday(this,false);
// setup alarm for daily agenda update
setupUpdateDailyAgendaAlarm();
//exportDatabase(this, DB_NAME, new File(Environment.getExternalStorageDirectory() + File.separator + DB_NAME));
=======
new Thread(new Runnable() {
@Override
public void run() {
DefaultDataGenerator.fillDBWithDummyData(getApplicationContext());
// initialize daily agenda
DailyAgenda.instance().setupForToday(CalendulaApp.this, false);
// setup alarm for daily agenda update
setupUpdateDailyAgendaAlarm();
List<Schedule> hourly = DB.schedules().findHourly();
Log.d("RFC", "Today: " + DateTime.now().toString());
Log.d("RFC", "Hourly schedules found: " + hourly.size());
for (Schedule s : hourly) {
Log.d("RFC", " ICAL: " + s.rule().toIcal());
Log.d("RFC", " Start: " + s.startTime()
.toDateTimeToday()
.toString("E dd MMM, kk:mm ZZZ"));
List<DateTime> dateTimes = s.rule()
.occurrencesBetween(s.startTime().toDateTimeToday().withTimeAtStartOfDay(),
s.startTime().toDateTimeToday().withTimeAtStartOfDay().plusDays(1), s);
Log.d("RFC", "Hourly schedule ocurrences today: " + dateTimes.size());
for (DateTime d : dateTimes) {
Log.d("RFC", " - DateTime: " + d.toString("E dd MMM, kk:mm ZZZ"));
}
}
}
}).start();
// exportDatabase(this, DB.DB_NAME, new File(Environment.getExternalStorageDirectory() + File.separator + DB.DB_NAME));
//forceLocale(Locale.GERMAN);
}
private void forceLocale(Locale l) {
Locale locale = new Locale(l.getLanguage());
Locale.setDefault(locale);
Configuration config = getApplicationContext().getResources().getConfiguration();
config.locale = locale;
getApplicationContext().getResources().updateConfiguration(config, getApplicationContext().getResources().getDisplayMetrics());
>>>>>>>
DefaultDataGenerator.fillDBWithDummyData(getApplicationContext());
// initialize daily agenda
DailyAgenda.instance().setupForToday(this,false);
// setup alarm for daily agenda update
setupUpdateDailyAgendaAlarm();
//exportDatabase(this, DB_NAME, new File(Environment.getExternalStorageDirectory() + File.separator + DB_NAME));
//forceLocale(Locale.GERMAN);
}
private void forceLocale(Locale l) {
Locale locale = new Locale(l.getLanguage());
Locale.setDefault(locale);
Configuration config = getApplicationContext().getResources().getConfiguration();
config.locale = locale;
getApplicationContext().getResources().updateConfiguration(config, getApplicationContext().getResources().getDisplayMetrics()); |
<<<<<<<
import com.doomonafireball.betterpickers.numberpicker.NumberPickerBuilder;
import com.doomonafireball.betterpickers.numberpicker.NumberPickerDialogFragment;
import com.mikepenz.community_material_typeface_library.CommunityMaterial;
=======
import com.j256.ormlite.stmt.PreparedQuery;
>>>>>>>
import com.j256.ormlite.stmt.PreparedQuery;
import com.doomonafireball.betterpickers.numberpicker.NumberPickerBuilder;
import com.doomonafireball.betterpickers.numberpicker.NumberPickerDialogFragment;
import com.mikepenz.community_material_typeface_library.CommunityMaterial;
<<<<<<<
import org.joda.time.LocalDate;
=======
import java.sql.SQLException;
>>>>>>>
import java.sql.SQLException;
import org.joda.time.LocalDate; |
<<<<<<<
final long remindScheduleId =
intent.getLongExtra(CalendulaApp.INTENT_EXTRA_SCHEDULE_ID, -1l);
final long delayScheduleId =
intent.getLongExtra(CalendulaApp.INTENT_EXTRA_DELAY_SCHEDULE_ID, -1l);
final String scheduleTime = intent.getStringExtra(CalendulaApp.INTENT_EXTRA_SCHEDULE_TIME);
=======
final long remindScheduleId = intent.getLongExtra(CalendulaApp.INTENT_EXTRA_SCHEDULE_ID, -1l);
final long delayScheduleId = intent.getLongExtra(CalendulaApp.INTENT_EXTRA_DELAY_SCHEDULE_ID, -1l);
final String scheduleTime = intent.getStringExtra(CalendulaApp.INTENT_EXTRA_SCHEDULE_TIME);
>>>>>>>
final long remindScheduleId = intent.getLongExtra(CalendulaApp.INTENT_EXTRA_SCHEDULE_ID, -1l);
final long delayScheduleId = intent.getLongExtra(CalendulaApp.INTENT_EXTRA_DELAY_SCHEDULE_ID, -1l);
final String scheduleTime = intent.getStringExtra(CalendulaApp.INTENT_EXTRA_SCHEDULE_TIME);
<<<<<<<
} else if (remindScheduleId != -1)
{
mDrawerLayout.closeDrawer(drawerView);
showReminder(remindScheduleId,
LocalTime.parse(scheduleTime, DateTimeFormat.forPattern("kk:mm")));
getIntent().removeExtra(CalendulaApp.INTENT_EXTRA_SCHEDULE_ID);
} else if (delayScheduleId != -1)
{
new Handler().postDelayed(new Runnable() {
@Override
public void run()
{
mViewPager.setCurrentItem(0);
mDrawerLayout.closeDrawer(drawerView);
final Schedule s = Schedule.findById(delayScheduleId);
LocalTime t = LocalTime.parse(scheduleTime, DateTimeFormat.forPattern("kk:mm"));
((DailyAgendaFragment) getViewPagerFragment(0)).showDelayDialog(s, t);
=======
} else if (remindScheduleId != -1) {
mDrawerLayout.closeDrawer(drawerView);
showReminder(remindScheduleId,
LocalTime.parse(scheduleTime, DateTimeFormat.forPattern("kk:mm")));
getIntent().removeExtra(CalendulaApp.INTENT_EXTRA_SCHEDULE_ID);
} else if (delayScheduleId != -1) {
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
mViewPager.setCurrentItem(0);
mDrawerLayout.closeDrawer(drawerView);
final Schedule s = Schedule.findById(delayScheduleId);
LocalTime t = LocalTime.parse(scheduleTime, DateTimeFormat.forPattern("kk:mm"));
((DailyAgendaFragment) getViewPagerFragment(0)).showDelayDialog(s, t);
>>>>>>>
} else if (remindScheduleId != -1) {
mDrawerLayout.closeDrawer(drawerView);
showReminder(remindScheduleId,
LocalTime.parse(scheduleTime, DateTimeFormat.forPattern("kk:mm")));
getIntent().removeExtra(CalendulaApp.INTENT_EXTRA_SCHEDULE_ID);
} else if (delayScheduleId != -1) {
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
mViewPager.setCurrentItem(0);
mDrawerLayout.closeDrawer(drawerView);
final Schedule s = Schedule.findById(delayScheduleId);
LocalTime t = LocalTime.parse(scheduleTime, DateTimeFormat.forPattern("kk:mm"));
((DailyAgendaFragment) getViewPagerFragment(0)).showDelayDialog(s, t);
<<<<<<<
case R.id.action_settings:
return true;
// case R.id.action_scan:
// startActivity(new Intent(this, ScanActivity.class));
// return true;
case R.id.action_calendar:
startActivity(new Intent(this, CalendarActivity.class));
return true;
=======
>>>>>>> |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.