GithubHelp home page GithubHelp logo

Comments (4)

valchkou avatar valchkou commented on August 23, 2024

No, this is not expected and indexes should not be recreated.
please provide the entity class sample which you did above but along with the properties declaration

from cassandra-driver-mapping.

DBatOWL avatar DBatOWL commented on August 23, 2024
@Table(name = "messages_by_conversation", //
    indexes = { @Index(columnList = "msgid"), @Index(columnList = "resource"), @Index(columnList = "senderid") })
@TableProperties(values = { @TableProperty("CLUSTERING ORDER BY (deletedOn ASC, timeSent DESC)") })
public class MessagesByConversation {

    @EmbeddedId
    private ConversationMessageKey key;

    @Column(columnDefinition = "timeuuid")
    private UUID msgId;

    @Column
    private String resource;

    @Column
    private String xmppId;

    @Column
    private String xmppThreadId;

    @Column(columnDefinition = "timeuuid")
    private UUID senderId;

    @Column
    private String content;

    @Column
    private Map<UUID, String> addresses;
}

public class ConversationMessageKey {

    @Column(columnDefinition = "timeuuid")
    private UUID convId;

    @Column
    private long deletedOn = 0;

    @Column
    private long timeSent;
}

For briefness I've removed the getters/setters but they all follow the same pattern as follows

    public ConversationMessageKey getKey() {
        return key;
    }

    public MessagesByConversation setKey(ConversationMessageKey value) {
        key = value;
        return this;
    }

from cassandra-driver-mapping.

DBatOWL avatar DBatOWL commented on August 23, 2024

BTW, I have the system.log file from a period where the app started that shows the creation/initialization of the indexes. Problem is I don't know how to attach it to the issue, seems I can only attach images, not text files. If you would like a copy of the log, let me know, along with where I can send it, and I'll get it to you.

from cassandra-driver-mapping.

valchkou avatar valchkou commented on August 23, 2024

I figured the issue:
you don't have name for indexes and that's why my program was recreating it each time. CZ name on entity didn't match with name in cassandra.
I pushed fix to not recreate the index for the column if it's already in cassandra.
Please reload from maven.

p.s.
Giving a name to index would also fix it.

from cassandra-driver-mapping.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.