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
defaults read com.apple.symbolichotkeys AppleSymbolicHotKeys | grep -A6 "\"60\"" | |
defaults write com.apple.symbolichotkeys AppleSymbolicHotKeys -dict-add 60 ' | |
{ | |
"enabled" = 0; | |
"value" = { | |
"parameters" = (32, 49, 262144); | |
"type" = "standard"; | |
}; | |
}' |
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
//MANIFEST Main-Class=org.mendrugo.fibula.MutiVmMain | |
package red.hat.puzzles.loom; | |
import java.lang.invoke.MethodHandle; | |
import java.lang.invoke.MethodHandles; | |
import java.lang.reflect.InvocationTargetException; | |
import java.lang.reflect.Method; | |
import java.util.concurrent.TimeUnit; | |
import org.openjdk.jmh.annotations.Benchmark; |
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
# | |
# MariaDB tuning meant for fast integration test execution: | |
# data is meant to be lost. Never use for actual database needs! | |
# | |
[mysqld] | |
# Disabling symbolic-links is recommended to prevent assorted security risks | |
symbolic-links = 0 |
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
SerializationContext serialCtx = ... | |
String protoFile = read(CryptoCurrency.class.getResourceAsStream("/crypto.proto")); | |
metadataCache.put("crypto.proto", protoFile); | |
... | |
serialCtx.registerProtoFiles(FileDescriptorSource.fromResources("/crypto.proto")); | |
serialCtx.registerMarshaller(new CryptoCurrencyMarshaller()); |
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
import org.infinispan.protostream.MessageMarshaller; | |
public class CryptoCurrencyMarshaller implements MessageMarshaller<CryptoCurrency> { | |
@Override | |
public CryptoCurrency readFrom(ProtoStreamReader reader) throws IOException { | |
String description = reader.readString("description"); | |
Integer rank = reader.readInt("rank"); | |
return new CryptoCurrency(description, rank); | |
} |
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
package crypto; | |
/** | |
* @Indexed | |
*/ | |
message CryptoCurrency { | |
/** | |
* @Field | |
*/ |
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
public class CryptoCurrency { | |
public final String description; | |
public final Integer rank; | |
.... | |
} |
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
RemoteCache<String, String> metadataCache = | |
remote.getCache(PROTOBUF_METADATA_CACHE_NAME); | |
metadataCache.put(fileName, protoFile); | |
String filesWithErrors = metadataCache.get(ERRORS_KEY_SUFFIX); | |
if (filesWithErrors != null) | |
throw new AssertionError("Error in proto file(s): " + filesWithErrors); | |
else | |
System.out.println("Added schema file: " + fileName); |
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
RemoteCacheManager remote = … | |
SerializationContext serialCtx = | |
ProtoStreamMarshaller.getSerializationContext(remote); | |
ProtoSchemaBuilder protoSchemaBuilder = new ProtoSchemaBuilder(); | |
String protoFile = protoSchemaBuilder | |
.fileName(fileName) | |
.addClass(Pokemon.class) | |
.packageName("pokemons") | |
.build(serialCtx); |
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
import org.infinispan.protostream.annotations.ProtoDoc; | |
import org.infinispan.protostream.annotations.ProtoField; | |
@ProtoDoc("@Indexed") | |
public class Pokemon { | |
@ProtoDoc("@Field") | |
@ProtoField(number = 10) | |
String name; |
NewerOlder