Skip to content

Instantly share code, notes, and snippets.

View galderz's full-sized avatar

Galder Zamarreño galderz

View GitHub Profile
@galderz
galderz / custom.cnf
Created September 12, 2022 15:50 — forked from Sanne/custom.cnf
MySQL configuration for testing
#
# 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
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());
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);
}
package crypto;
/**
* @Indexed
*/
message CryptoCurrency {
/**
* @Field
*/
public class CryptoCurrency {
public final String description;
public final Integer rank;
....
}
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);
RemoteCacheManager remote = …
SerializationContext serialCtx =
ProtoStreamMarshaller.getSerializationContext(remote);
ProtoSchemaBuilder protoSchemaBuilder = new ProtoSchemaBuilder();
String protoFile = protoSchemaBuilder
.fileName(fileName)
.addClass(Pokemon.class)
.packageName("pokemons")
.build(serialCtx);
import org.infinispan.protostream.annotations.ProtoDoc;
import org.infinispan.protostream.annotations.ProtoField;
@ProtoDoc("@Indexed")
public class Pokemon {
@ProtoDoc("@Field")
@ProtoField(number = 10)
String name;

ISPN-9194 EntityRegionAccessStrategyTest.testRemoveAll (25.05_2)

Try locate the size() calls at the end of testRemove

grep  -nH -e "org.infinispan.test.hibernate.cache.commons.entity.EntityRegionAccessStrategyTest" infinispan.log
...
infinispan.log:170081:2018-05-25 19:14:08,648 INFO  [org.hibernate.testing.junit4.CustomRunner] (main:[]) Test: testRemove
...
infinispan.log:170369:2018-05-25 19:14:08,654 DEBUG [org.infinispan.test.hibernate.cache.commons.entity.EntityRegionAccessStrategyTest] (Time-limited test:[]) Create end invalidation latch: java.util.concurrent.CountDownLatch@6b412650[Count = 0]
...
2018-05-25 19:14:08,654 DEBUG [org.hibernate.engine.transaction.internal.TransactionImpl] (Time-limited test:[]) begin
@galderz
galderz / clean-install-high-sierra-apfs.md
Last active July 3, 2019 21:11
How To Clean Install High Sierra on APFS-formatted main HD

Clean Install High Sierra on APFS-formatted main HD

Installation Steps

  1. From 10.11 or 10.12 systems, format an external hard drive with at least 500gb with "Mac Os Extended Journaled".
  2. Download High Sierra Beta and install it in the external hard drive.
  3. When the system reboots and finishes installation, it will boot from the external HD. Go to Preferences and change Startup Disk to be main HD.
  4. Reboot and press Option key when the computer makes a beep and select external HD to boot from it.
  5. Once booted again into external HD, format main HD to be APFS.