This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@SpaceClass | |
public class WanTimeStamp implements Serializable{ | |
private Long time; | |
private String location; | |
public TimeStamp(){ | |
} | |
public TimeStamp(String loc){ | |
this.location=loc; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.... | |
SimplePollingEventContainerListener pec=new | |
SimplePollingContainerConfigurer(space) | |
.template(query) | |
.transactionManager(tm) | |
.eventListenerAnnotation(new Object(){ | |
@SpaceDataEvent | |
public TimeStamp eventListener(TimeStamp event){ | |
TimeRecord lt=getSpace().readById(TimeRecord.class, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@SpaceClass | |
public class TimeRecord implements Serializable{ | |
private static Logger log=Logger. | |
getLogger(TimeRecord.class.getName()); | |
private String location=null; | |
private List<TimeEntry> timelog=null; | |
private final int logsize=10; //arbitrary | |
//Only to be used for constructing templates | |
public TimeRecord(){} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Component | |
@Retention(RetentionPolicy.RUNTIME) | |
@Target(ElementType.TYPE) | |
@Inherited | |
public @interface Persistent { | |
Class<? extends BulkDataPersister>[] persistTo() default {NullBulkDataPersister.class}; | |
Class<? extends ManagedDataSource<?>> loadFrom() default NullManagedDataSource.class; | |
} | |
class NullBulkDataPersister implements BulkDataPersister{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<bean id="multiEDS" class="org.openspaces.eds.support.MultiEDS"> | |
<property name="persisters"> | |
<list> | |
<ref local="hdfsEDS"/> | |
<ref local="cassandraEDS"/> | |
</list> | |
</property> | |
</bean> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<os-core:space id="space" url="/./space" > | |
<os-core:space-type type-name="Product" > | |
<os-core:id property="CatalogNumber"/> | |
<os-core:routing property="Category"/> | |
<os-core:basic-index path="Name"/> | |
<os-core:extended-index path="Price"/> | |
</os-core:space-type> | |
</os-core:space> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@SpaceDocument(name="Product") | |
@Persistent(persistTo={CassandraEDS.class,HdfsPersisterEDS.class}, loadFrom=CassandraEDS.class) | |
public class Product { | |
@DocumentId | |
Integer catalogNumber; | |
@DocumentRouting | |
String category; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- annotation driven document definition --> | |
<bean id="defmaker" class="org.openspaces.eds.support.SpaceTypeMaker"/> | |
<bean id="deffactory" class="org.springframework.beans.factory.config.MethodInvokingFactoryBean"> | |
<property name="targetObject"><ref local="defmaker"/></property> | |
<property name="targetMethod"><value>getSpaceTypes</value></property> | |
</bean> | |
<bean id="space" class="org.openspaces.core.space.UrlSpaceFactoryBean"> | |
..... | |
<property name="spaceTypes"><ref bean="deffactory"/></property> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def binding=["hosts":ips,"clientPort":"${config.clientPort}"] | |
def zoo = new File('templates/zoo.cfg') | |
engine = new SimpleTemplateEngine() | |
template = engine.createTemplate(zoo).make(binding) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo stat |nc 127.0.0.1 $PORT |awk -F : '{gsub(/ */,"");if ($1 == "Received" || $1 == "Sent" || $1 == "Outstanding") print $2}' |
OlderNewer